diff options
| author | Sebastian Dröge <sebastian@centricular.com> | 2023-04-13 16:09:03 +0300 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2023-04-14 06:11:44 -0400 |
| commit | 49e62877d14fee68baf854fde3c13f58a97384de (patch) | |
| tree | 654cfc75d5427202a2a4fac2b02a923e68a0fe45 /test cases/rust | |
| parent | 93cafe7b14c23ba4b6ef59267c584714afb8f0e8 (diff) | |
| download | meson-49e62877d14fee68baf854fde3c13f58a97384de.tar.gz | |
rust: Don't pass dependency compile arguments to the compiler
Rust doesn't have a concept of dependency compile arguments, i.e.
something like headers. Dependencies are linked in and all required
metadata is provided by the linker flags.
Diffstat (limited to 'test cases/rust')
| -rw-r--r-- | test cases/rust/16 internal c dependencies/meson.build | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test cases/rust/16 internal c dependencies/meson.build b/test cases/rust/16 internal c dependencies/meson.build index c7476d750..f45982867 100644 --- a/test cases/rust/16 internal c dependencies/meson.build +++ b/test cases/rust/16 internal c dependencies/meson.build @@ -3,12 +3,16 @@ project('internal dependencies', 'c', 'rust') test_prog = find_program('test.py') static = static_library('static', 'lib.c', c_args : '-DMODE="static"') -exe = executable('static', 'main.rs', link_with : static) +# Add some -I compiler arguments to make sure they're not passed to the Rust +# compiler when handling the dependency. +static_dep = declare_dependency(link_with : static, compile_args : ['-Idoesnotexist']) +exe = executable('static', 'main.rs', dependencies : static_dep) test('static linkage', test_prog, args : [exe, 'This is a static C library']) # Shared linkage with rust doesn't work on macOS with meson, yet if host_machine.system() != 'darwin' shared = shared_library('shared', 'lib.c', c_args : '-DMODE="shared"') - exe = executable('shared', 'main.rs', link_with : shared) + shared_dep = declare_dependency(link_with : shared, compile_args : ['-Idoesnotexist']) + exe = executable('shared', 'main.rs', dependencies : shared_dep) test('shared linkage', test_prog, args : [exe, 'This is a shared C library']) endif |
