Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
env flag for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
iopapamanoglou committed Nov 7, 2024
1 parent 2b62a72 commit a8ffbc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/faebryk/core/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions src/faebryk/core/cpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
[
Expand Down

0 comments on commit a8ffbc0

Please sign in to comment.