diff options
-rw-r--r-- | mesonbuild/build.py | 2 | ||||
-rw-r--r-- | test cases/rust/18 proc-macro/lib.rs | 8 | ||||
-rw-r--r-- | test cases/rust/18 proc-macro/meson.build | 11 | ||||
-rw-r--r-- | test cases/rust/18 proc-macro/subdir/meson.build | 1 | ||||
-rw-r--r-- | test cases/rust/18 proc-macro/transitive-proc-macro.rs | 7 |
5 files changed, 27 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 8e41f0b..3c9d3a0 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1295,8 +1295,6 @@ class BuildTarget(Target): for t in self.link_targets: if t in result: continue - if t.rust_crate_type == 'proc-macro': - continue if include_internals or not t.is_internal(): result.add(t) if isinstance(t, StaticLibrary): diff --git a/test cases/rust/18 proc-macro/lib.rs b/test cases/rust/18 proc-macro/lib.rs new file mode 100644 index 0000000..5242886 --- /dev/null +++ b/test cases/rust/18 proc-macro/lib.rs @@ -0,0 +1,8 @@ +extern crate proc_macro_examples; +use proc_macro_examples::make_answer; + +make_answer!(); + +pub fn func() -> u32 { + answer() +} diff --git a/test cases/rust/18 proc-macro/meson.build b/test cases/rust/18 proc-macro/meson.build index c5f0dfc..e8b28ed 100644 --- a/test cases/rust/18 proc-macro/meson.build +++ b/test cases/rust/18 proc-macro/meson.build @@ -31,3 +31,14 @@ main = executable( ) test('main_test2', main) + +subdir('subdir') + +staticlib = static_library('staticlib', 'lib.rs', + link_with: pm_in_subdir, + rust_dependency_map : {'proc_macro_examples3' : 'proc_macro_examples'} +) + +executable('transitive-proc-macro', 'transitive-proc-macro.rs', + link_with: staticlib, +) diff --git a/test cases/rust/18 proc-macro/subdir/meson.build b/test cases/rust/18 proc-macro/subdir/meson.build new file mode 100644 index 0000000..04842c4 --- /dev/null +++ b/test cases/rust/18 proc-macro/subdir/meson.build @@ -0,0 +1 @@ +pm_in_subdir = rust.proc_macro('proc_macro_examples3', '../proc.rs') diff --git a/test cases/rust/18 proc-macro/transitive-proc-macro.rs b/test cases/rust/18 proc-macro/transitive-proc-macro.rs new file mode 100644 index 0000000..4c804b3 --- /dev/null +++ b/test cases/rust/18 proc-macro/transitive-proc-macro.rs @@ -0,0 +1,7 @@ +extern crate staticlib; +use staticlib::func; + + +fn main() { + assert_eq!(42, func()); +} |