summaryrefslogtreecommitdiff
path: root/unittests/windowstests.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-09-15 10:28:12 +0200
committerDylan Baker <dylan@pnwbakers.com>2025-09-24 07:48:22 -0700
commitb91fede6d263286fa1e20d424f92d1e10668a8ed (patch)
treea62a36bad4ed34bb81decd559b490920414ca715 /unittests/windowstests.py
parent199e468e43cf69fb39733432e42899a2d984c198 (diff)
downloadmeson-b91fede6d263286fa1e20d424f92d1e10668a8ed.tar.gz
compilers: clang: map -Db_vscrt to -fms-runtime-lib
The main complication here is that passing -fms-runtime-lib during compilation results in a warning: clang: error: argument unused during compilation: '-fms-runtime-lib=dll' [-Werror,-Wunused-command-line-argument] (https://github.com/mesonbuild/meson/actions/runs/17727020048/job/50369771571). So, for compilation expand the -D flags by hand, and only pass -fms-runtime-lib when linking. Fixes: #14571 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests/windowstests.py')
-rw-r--r--unittests/windowstests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/windowstests.py b/unittests/windowstests.py
index 2cb1407c1..bf1225d18 100644
--- a/unittests/windowstests.py
+++ b/unittests/windowstests.py
@@ -398,7 +398,16 @@ class WindowsTests(BasePlatformTests):
if OptionKey('b_vscrt') not in cc.base_options:
raise SkipTest('Compiler does not support setting the VS CRT')
+ MSVCRT_MAP = {
+ '/MD': '-fms-runtime-lib=dll',
+ '/MDd': '-fms-runtime-lib=dll_dbg',
+ '/MT': '-fms-runtime-lib=static',
+ '/MTd': '-fms-runtime-lib=static_dbg',
+ }
+
def sanitycheck_vscrt(vscrt):
+ if cc.get_argument_syntax() != 'msvc':
+ vscrt = MSVCRT_MAP[vscrt]
checks = self.get_meson_log_sanitychecks()
self.assertGreater(len(checks), 0)
for check in checks: