From ca0ec66913f8b60940a4d661ffb9912516b3bf68 Mon Sep 17 00:00:00 2001 From: Thomas Goodfellow Date: Fri, 19 Apr 2024 11:23:25 +0200 Subject: [PATCH] Debug flag subordinate to any CMAKE_BUILD_TYPE In practice the debug flag is being left defaulted to None but was still overriding the build type --- seal5/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seal5/utils.py b/seal5/utils.py index d8f34617..1059b14c 100644 --- a/seal5/utils.py +++ b/seal5/utils.py @@ -145,8 +145,9 @@ def cmake(src, *args, debug: Optional[bool] = None, use_ninja: Optional[bool] = if isinstance(cwd, Path): cwd = str(cwd.resolve()) extraArgs = [] - if debug is not None: - buildType = "Debug" if debug else "Release" + if not any("CMAKE_BUILD_TYPE" in x for x in args): + if debug is not None: + buildType = "Debug" if debug else "Release" extraArgs.append("-DCMAKE_BUILD_TYPE=" + buildType) if use_ninja: extraArgs.append("-GNinja")