diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-10-17 10:39:10 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2023-10-20 20:21:08 +0530 |
commit | 450b3db37810c99854f670cb70a59e0bee5b8777 (patch) | |
tree | 27ff4fda7db3fdd9fa45dc52b9bb656d2a8e0dd1 /test cases/rust | |
parent | e6e07f46ea64aead8fecb6f623c795ea3d8e62a2 (diff) | |
download | meson-450b3db37810c99854f670cb70a59e0bee5b8777.zip meson-450b3db37810c99854f670cb70a59e0bee5b8777.tar.gz meson-450b3db37810c99854f670cb70a59e0bee5b8777.tar.bz2 |
modules/rust: Add a test that bindgen drops arguments it shouldn't use
This does require hacking up the test pretty badly, since we need to not
ever pass GCC these invalid values. But it's preferable to writing
another project test I think.
Co-Authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
Diffstat (limited to 'test cases/rust')
-rw-r--r-- | test cases/rust/12 bindgen/meson.build | 12 | ||||
-rw-r--r-- | test cases/rust/12 bindgen/test.json | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/test cases/rust/12 bindgen/meson.build b/test cases/rust/12 bindgen/meson.build index e7cb5f3..e36e9e2 100644 --- a/test cases/rust/12 bindgen/meson.build +++ b/test cases/rust/12 bindgen/meson.build @@ -8,8 +8,16 @@ if not prog_bindgen.found() error('MESON_SKIP_TEST bindgen not found') endif -add_project_arguments('-DPROJECT_ARG', language : 'c') -add_global_arguments('-DGLOBAL_ARG', language : 'c') +cc_id = meson.get_compiler('c').get_id() +compiler_specific_args = [] +if cc_id == 'gcc' + compiler_specific_args = ['-mtls-dialect=gnu2'] +elif cc_id == 'msvc' + compiler_specific_args = ['/fp:fast'] +endif + +add_project_arguments(['-DPROJECT_ARG', compiler_specific_args], language : 'c') +add_global_arguments(['-DGLOBAL_ARG', compiler_specific_args], language : 'c') # This seems to happen on windows when libclang.dll is not in path or is not # valid. We must try to process a header file for this to work. diff --git a/test cases/rust/12 bindgen/test.json b/test cases/rust/12 bindgen/test.json index b3a7585..d45543b 100644 --- a/test cases/rust/12 bindgen/test.json +++ b/test cases/rust/12 bindgen/test.json @@ -4,7 +4,7 @@ }, "stdout": [ { - "line": "test cases/rust/12 bindgen/meson.build:30: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]." + "line": "test cases/rust/12 bindgen/meson.build:38: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]." } ] } |