From 658fe7243b1415bd4d2d1ae36d9beb3ed33c5e67 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 16 Oct 2023 15:17:31 -0700 Subject: modules/rust: remove rust_crate_type for test() method This is required to test non-executable targets when they set an explicit type. --- mesonbuild/modules/rust.py | 1 + test cases/rust/9 unit tests/meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py index 98bf05312..0781b3200 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 94cc400d4..b444271ae 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) -- cgit v1.2.3