diff options
Diffstat (limited to 'mesonbuild/cmake/common.py')
-rw-r--r-- | mesonbuild/cmake/common.py | 12 |
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 |