diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-10-16 15:17:31 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2023-10-16 17:31:12 -0700 |
commit | 658fe7243b1415bd4d2d1ae36d9beb3ed33c5e67 (patch) | |
tree | 5aff80ed485cdb78fe54c51f37a26f1addfb5921 | |
parent | 74771d211946eb1d966051af1f310e0934bacd3d (diff) | |
download | meson-658fe7243b1415bd4d2d1ae36d9beb3ed33c5e67.zip meson-658fe7243b1415bd4d2d1ae36d9beb3ed33c5e67.tar.gz meson-658fe7243b1415bd4d2d1ae36d9beb3ed33c5e67.tar.bz2 |
modules/rust: remove rust_crate_type for test() method
This is required to test non-executable targets when they set an
explicit type.
-rw-r--r-- | mesonbuild/modules/rust.py | 1 | ||||
-rw-r--r-- | test cases/rust/9 unit tests/meson.build | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py index 98bf053..0781b32 100644 --- a/mesonbuild/modules/rust.py +++ b/mesonbuild/modules/rust.py @@ -162,6 +162,7 @@ class RustModule(ExtensionModule): new_target_kwargs['install'] = False new_target_kwargs['dependencies'] = new_target_kwargs.get('dependencies', []) + kwargs['dependencies'] new_target_kwargs['link_with'] = new_target_kwargs.get('link_with', []) + kwargs['link_with'] + del new_target_kwargs['rust_crate_type'] lang_args = base_target.extra_args.copy() lang_args['rust'] = base_target.extra_args['rust'] + kwargs['rust_args'] + ['--test'] diff --git a/test cases/rust/9 unit tests/meson.build b/test cases/rust/9 unit tests/meson.build index 94cc400..b444271 100644 --- a/test cases/rust/9 unit tests/meson.build +++ b/test cases/rust/9 unit tests/meson.build @@ -36,7 +36,7 @@ exe = executable('rust_exe', ['test2.rs', 'test.rs'], build_by_default : false) rust = import('unstable-rust') rust.test('rust_test_from_exe', exe, should_fail : true) -lib = static_library('rust_static', ['test.rs'], build_by_default : false) +lib = static_library('rust_static', ['test.rs'], build_by_default : false, rust_crate_type : 'lib') rust.test('rust_test_from_static', lib, args: ['--skip', 'test_add_intentional_fail']) lib = shared_library('rust_shared', ['test.rs'], build_by_default : false) |