diff options
author | Alexander Neumann <Alexander.Neumann@hamburg.de> | 2020-05-24 00:40:19 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-05-24 12:59:53 +0200 |
commit | ec7ee8fd9e9d5578b10fcd32b5121215065aaf98 (patch) | |
tree | 85892ff0aa74a644fd0171a5aeadca45a2fbbc57 | |
parent | 187865c5a824054651b7e816cc83700a34c541f8 (diff) | |
download | meson-ec7ee8fd9e9d5578b10fcd32b5121215065aaf98.tar.gz |
fix cmake target configuration selection.
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 13 | ||||
-rw-r--r-- | mesonbuild/dependencies/base.py | 11 |
2 files changed, 19 insertions, 5 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index 35eb17c49..09b633e8b 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -355,9 +355,16 @@ class ConverterTarget: if 'CONFIGURATIONS' in tgt.properties: cfgs += [x for x in tgt.properties['CONFIGURATIONS'] if x] cfg = cfgs[0] - - if 'RELEASE' in cfgs: - cfg = 'RELEASE' + + is_debug = self.env.coredata.get_builtin_option('debug'); + if is_debug: + if 'DEBUG' in cfgs: + cfg = 'DEBUG' + elif 'RELEASE' in cfgs: + cfg = 'RELEASE' + else: + if 'RELEASE' in cfgs: + cfg = 'RELEASE' if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properties: libraries += [x for x in tgt.properties['IMPORTED_IMPLIB_{}'.format(cfg)] if x] diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index bcb153139..b0401c63a 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1443,8 +1443,15 @@ class CMakeDependency(ExternalDependency): cfgs = [x for x in tgt.properties['IMPORTED_CONFIGURATIONS'] if x] cfg = cfgs[0] - if 'RELEASE' in cfgs: - cfg = 'RELEASE' + is_debug = self.env.coredata.get_builtin_option('debug'); + if is_debug: + if 'DEBUG' in cfgs: + cfg = 'DEBUG' + elif 'RELEASE' in cfgs: + cfg = 'RELEASE' + else: + if 'RELEASE' in cfgs: + cfg = 'RELEASE' if 'IMPORTED_IMPLIB_{}'.format(cfg) in tgt.properties: libraries += [x for x in tgt.properties['IMPORTED_IMPLIB_{}'.format(cfg)] if x] |