diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-08-05 21:48:03 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-08-05 19:50:24 +0000 |
commit | d4ec080f732a36a361911c3949e5644512642852 (patch) | |
tree | f795d5547a82bea666a434705e787abaddd89392 /mesonbuild/dependencies/base.py | |
parent | adbed4c636c295093f5d5da13eb9b433e592225c (diff) | |
download | meson-d4ec080f732a36a361911c3949e5644512642852.zip meson-d4ec080f732a36a361911c3949e5644512642852.tar.gz meson-d4ec080f732a36a361911c3949e5644512642852.tar.bz2 |
cmake: Use the DEBUG config when linking to the debug CRT
The `debug` builtin option does not control whether or not the debug
CRT is used. Without this fix, when buildtype=debugoptimized or when
debug=true + b_vscrt=md, we will try to link to the debug libraries
found via cmake while linking with `/release`, which will cause a link
failure.
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index c726a7e..368a4bc 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1450,7 +1450,10 @@ class CMakeDependency(ExternalDependency): cfgs = [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x] cfg = cfgs[0] - is_debug = self.env.coredata.get_builtin_option('debug'); + is_debug = self.env.coredata.get_builtin_option('buildtype') == 'debug' + if 'b_vscrt' in self.env.coredata.base_options: + if self.env.coredata.base_options['b_vscrt'].value in ('mdd', 'mtd'): + is_debug = True if is_debug: if 'DEBUG' in cfgs: cfg = 'DEBUG' |