forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: recursively pull proc-macro dependencies as well
When the proc-macro rlib is in a different subdir, it would miss the needed -L argument and rustc would not find it. Meson was assuming that proc-macros are only needed when building libraries that uses it, but it turns out that was wrong, as show by the unit test.
- Loading branch information
Showing
5 changed files
with
27 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extern crate proc_macro_examples; | ||
use proc_macro_examples::make_answer; | ||
|
||
make_answer!(); | ||
|
||
pub fn func() -> u32 { | ||
answer() | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pm_in_subdir = rust.proc_macro('proc_macro_examples3', '../proc.rs') |
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,7 @@ | ||
extern crate staticlib; | ||
use staticlib::func; | ||
|
||
|
||
fn main() { | ||
assert_eq!(42, func()); | ||
} |