aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/common.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-11-27 19:58:04 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2021-12-01 21:03:36 +0200
commit45c5300496486ff9f1f3d47a01cdf19b8fa7e877 (patch)
tree97f3c7c077df90cc60e83ee4e0bf85e5379f9a4e /mesonbuild/cmake/common.py
parent4f882ff8ec81cbc42b097d3aee8ca4a8013f538b (diff)
downloadmeson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.zip
meson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.tar.gz
meson-45c5300496486ff9f1f3d47a01cdf19b8fa7e877.tar.bz2
cmake: Fix old style dependency lookup with imported targets
This also includes some refactoring, since the alternaticve would have been to duplicate the huge traceparser target code block again. fixes #9581
Diffstat (limited to 'mesonbuild/cmake/common.py')
-rw-r--r--mesonbuild/cmake/common.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesonbuild/cmake/common.py b/mesonbuild/cmake/common.py
index f6ba5ec..7130248 100644
--- a/mesonbuild/cmake/common.py
+++ b/mesonbuild/cmake/common.py
@@ -61,6 +61,18 @@ blacklist_cmake_defs = [
'MESON_CMAKE_ROOT',
]
+def cmake_is_debug(env: 'Environment') -> bool:
+ if OptionKey('b_vscrt') in env.coredata.options:
+ is_debug = env.coredata.get_option(OptionKey('buildtype')) == 'debug'
+ if env.coredata.options[OptionKey('b_vscrt')].value in {'mdd', 'mtd'}:
+ is_debug = True
+ return is_debug
+ else:
+ # Don't directly assign to is_debug to make mypy happy
+ debug_opt = env.coredata.get_option(OptionKey('debug'))
+ assert isinstance(debug_opt, bool)
+ return debug_opt
+
class CMakeException(MesonException):
pass