diff --git a/src/faebryk/core/cpp/CMakeLists.txt b/src/faebryk/core/cpp/CMakeLists.txt index 11f9f92f..253fd8da 100644 --- a/src/faebryk/core/cpp/CMakeLists.txt +++ b/src/faebryk/core/cpp/CMakeLists.txt @@ -39,6 +39,7 @@ message(STATUS "Python_INCLUDE_DIR: ${Python_INCLUDE_DIR}") message(STATUS "Python_LIBRARY: ${Python_LIBRARY}") # To make a debug build, run cmake with -DCMAKE_BUILD_TYPE=Debug +# or in environment: FBRK_CPP_DEBUG_BUILD=y if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") diff --git a/src/faebryk/core/cpp/__init__.py b/src/faebryk/core/cpp/__init__.py index 40224b45..085cdb7d 100644 --- a/src/faebryk/core/cpp/__init__.py +++ b/src/faebryk/core/cpp/__init__.py @@ -11,6 +11,7 @@ LEAK_WARNINGS = ConfigFlag("CPP_LEAK_WARNINGS", default=False) +DEBUG_BUILD = ConfigFlag("CPP_DEBUG_BUILD", default=False) # Check if installed as editable @@ -63,6 +64,9 @@ def compile_and_load(): if arch in ["arm64", "x86_64"]: other_flags += [f"-DCMAKE_OSX_ARCHITECTURES={arch}"] + if DEBUG_BUILD: + other_flags += ["-DCMAKE_BUILD_TYPE=Debug"] + with global_lock(_build_dir / "lock", timeout_s=60): run_live( [