aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wendt <cwe@skov.dk>2022-06-07 11:23:51 +0200
committerEli Schwartz <eschwartz93@gmail.com>2022-07-15 11:26:01 -0400
commit468022f91c3c9eb5b98ac5c62928afac9b9139b2 (patch)
tree0c3285af350318052a2a820b621f798c79e21353
parent5851c133a0d336c2f7cef2f7d155e30f9fcc5d9a (diff)
downloadmeson-468022f91c3c9eb5b98ac5c62928afac9b9139b2.zip
meson-468022f91c3c9eb5b98ac5c62928afac9b9139b2.tar.gz
meson-468022f91c3c9eb5b98ac5c62928afac9b9139b2.tar.bz2
backends: Remove /Zi arg if requested to use /Z7
Change the order of testing flags and get_external_args() to handle flags set by get_external_args() correctly.
-rw-r--r--mesonbuild/backend/backends.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index c3c44e6..1505206 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -952,15 +952,15 @@ class Backend:
# Add compile args added using add_global_arguments()
# These override per-project arguments
commands += self.build.get_global_args(compiler, target.for_machine)
- # Using both /ZI and /Zi at the same times produces a compiler warning.
- # We do not add /ZI by default. If it is being used it is because the user has explicitly enabled it.
- # /ZI needs to be removed in that case to avoid cl's warning to that effect (D9025 : overriding '/ZI' with '/Zi')
- if ('/ZI' in commands) and ('/Zi' in commands):
- commands.remove('/Zi')
# Compile args added from the env: CFLAGS/CXXFLAGS, etc, or the cross
# file. We want these to override all the defaults, but not the
# per-target compile args.
commands += self.environment.coredata.get_external_args(target.for_machine, compiler.get_language())
+ # Using both /Z7 or /ZI and /Zi at the same times produces a compiler warning.
+ # We do not add /Z7 or /ZI by default. If it is being used it is because the user has explicitly enabled it.
+ # /Zi needs to be removed in that case to avoid cl's warning to that effect (D9025 : overriding '/Zi' with '/ZI')
+ if ('/Zi' in commands) and (('/ZI' in commands) or ('/Z7' in commands)):
+ commands.remove('/Zi')
# Always set -fPIC for shared libraries
if isinstance(target, build.SharedLibrary):
commands += compiler.get_pic_args()