forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add `syn` and others as dependencies of `macros` crate, and use cargo to build `macros` crate. Only host-facing `libmacros.so` is built this way, not any of the other crates that are compiled for the target. This cargo invocation has all crate versions locked and has `--offline` option specified, so it won't access Internet during the build. The current `module!` crate already shows it tedious and limited for writing proc macros without `syn`. Pinning and vtable handling could likely be drastically improved with the help of proc macros, and they will require parsing Rust struct/trait/impl blocks. A dependency on `syn` is highly desirable to avoid us essentially reinventing the wheel when building our procedural macros. A `make rust-fetch-deps` command is added and listed in the documentation as a build requirement. Signed-off-by: Gary Guo <[email protected]>
- Loading branch information
Showing
7 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
bindings_generated.rs | ||
exports_*_generated.h | ||
doc/ | ||
doc/ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "macros" | ||
version = "0.0.0" | ||
edition = "2018" | ||
license = "GPL-2.0-only" | ||
|
||
[lib] | ||
path = "lib.rs" | ||
proc_macro = true | ||
|
||
[dependencies] | ||
syn = { version = "1.0", features = ["full"] } | ||
quote = "1.0" | ||
proc-macro2 = "1.0" |