diff options
| author | L. E. Segovia <amy@amyspark.me> | 2023-08-24 13:42:15 -0300 |
|---|---|---|
| committer | L. E. Segovia <amy@amyspark.me> | 2024-02-25 10:48:45 -0300 |
| commit | f3fad6cc5f948b0c7557bdce3959c71420183be9 (patch) | |
| tree | 2c6cda4b91933ac5c729e9b58b7f1bced4f33f98 /test cases/common | |
| parent | c5254429e4fdad4058104dc4c00531c0f7b109b6 (diff) | |
| download | meson-f3fad6cc5f948b0c7557bdce3959c71420183be9.tar.gz | |
compilers: Add test for correct forwarding of flags to MSVC's Clang linkers
Diffstat (limited to 'test cases/common')
| -rw-r--r-- | test cases/common/180 has link arg/meson.build | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test cases/common/180 has link arg/meson.build b/test cases/common/180 has link arg/meson.build index 6bfbd59e7..111b0b9ea 100644 --- a/test cases/common/180 has link arg/meson.build +++ b/test cases/common/180 has link arg/meson.build @@ -45,3 +45,23 @@ endif assert(cc.has_multi_link_arguments(is_arg), 'Arg that should have worked does not work.') assert(cc.has_multi_link_arguments([useless, is_arg]), 'Arg that should have worked does not work.') + +# These are Visual Studio only flags +# Testing has_argument_syntax is incorrect as it skips Microsoft Clang +if cc.get_define('_MSC_FULL_VER') != '' + if cc.get_linker_id() == 'link' + is_only = '/OPT:REF' + is_shared = '/GUARD:CF' + else # ld-link + is_only = '--color-diagnostics' + is_shared = '-guard:cf' + endif + + # requires -Wl,xxx as it goes through the compiler + if cc.get_argument_syntax() != 'msvc' + is_only = '-Wl,@0@'.format(is_only) + is_shared = '-Wl,@0@'.format(is_shared) + endif + + assert(cc.has_multi_link_arguments([is_only, is_shared]), 'Arg that should have worked does not work.') +endif |
