aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorMarios Staikopoulos <marios@staik.net>2021-01-10 14:52:46 -0800
committerJussi Pakkanen <jpakkane@gmail.com>2021-01-17 21:03:35 +0000
commita3d8dc546c1a83f9e99f729ed5966d0e95581ac2 (patch)
tree1dfcf0ccc0a9712827a3a78eb2d4a7c4b9b074b1 /mesonbuild/backend/backends.py
parent903c8716e373f829ef1d48712b26ad61d576436b (diff)
downloadmeson-a3d8dc546c1a83f9e99f729ed5966d0e95581ac2.zip
meson-a3d8dc546c1a83f9e99f729ed5966d0e95581ac2.tar.gz
meson-a3d8dc546c1a83f9e99f729ed5966d0e95581ac2.tar.bz2
Removal of /ZI on MSVC Debug
The /ZI flag adds in "Edit and Continue" debug information, which will cause massive slowdown. It is not a flag that we should be adding by default to debug builds. /Zi will still be added.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 92e6c15..ced1d7d 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -717,15 +717,16 @@ class Backend:
commands += compiler.get_buildtype_args(self.get_option_for_target(OptionKey('buildtype'), target))
commands += compiler.get_optimization_args(self.get_option_for_target(OptionKey('optimization'), target))
commands += compiler.get_debug_args(self.get_option_for_target(OptionKey('debug'), target))
- # MSVC debug builds have /ZI argument by default and /Zi is added with debug flag
- # /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')
# Add compile args added using add_project_arguments()
commands += self.build.get_project_args(compiler, target.subproject, target.for_machine)
# 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.