diff options
author | Vili Väinölä <vilivainola@gmail.com> | 2020-09-27 14:12:46 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-09-29 19:25:50 +0300 |
commit | d1638a4fde5be879fe7778200b6ae6d59106a25e (patch) | |
tree | 0ce114f2e263ab0c965974f55963d657a769755d /mesonbuild/backend/backends.py | |
parent | 5f70984403e48e72e22991882ac6ffa03d6ce18e (diff) | |
download | meson-d1638a4fde5be879fe7778200b6ae6d59106a25e.zip meson-d1638a4fde5be879fe7778200b6ae6d59106a25e.tar.gz meson-d1638a4fde5be879fe7778200b6ae6d59106a25e.tar.bz2 |
compilers/VS: fix build to use optimization and debug flags
- Fixed using debug and optimization built-in options in MSVC.
- Fixed that VS backend does not create pdb files in release mode.
VS implicitly adds the debug fields if left out.
- Fix that it is possible to add debug info with ninja backend with
optimizations.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 85d5eb6..a8b6df9 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -685,6 +685,10 @@ class Backend: commands += compiler.get_buildtype_args(self.get_option_for_target('buildtype', target)) commands += compiler.get_optimization_args(self.get_option_for_target('optimization', target)) commands += compiler.get_debug_args(self.get_option_for_target('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() |