Skip to content

Commit 3dd3368

Browse files
committed
Build in Debug with CMAKE_UNITY_BUILD
This gives the fastest bootstrapping times and cmkr isn't noticeably slower during generation.
1 parent bb7874a commit 3dd3368

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Build
2525
run: |
26-
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
26+
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_UNITY_BUILD=ON
2727
cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
2828
cmake --install build --prefix ./install --config ${{ env.BUILD_TYPE }}
2929

cmake/cmkr.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set(CMKR_TAG "archive_52671dcf" CACHE STRING "cmkr git tag (this needs to be ava
1111
# Set these from the command line to customize for development/debugging purposes
1212
set(CMKR_EXECUTABLE "" CACHE FILEPATH "cmkr executable")
1313
set(CMKR_SKIP_GENERATION OFF CACHE BOOL "skip automatic cmkr generation")
14+
set(CMKR_BUILD_TYPE "Debug" CACHE STRING "cmkr build configuration")
1415

1516
# Disable cmkr if generation is disabled
1617
if(DEFINED ENV{CI} OR CMKR_SKIP_GENERATION OR CMKR_BUILD_SKIP_GENERATION)
@@ -86,18 +87,19 @@ else()
8687
--no-warn-unused-cli
8788
"${CMKR_DIRECTORY}"
8889
"-B${CMKR_DIRECTORY}/build"
89-
"-DCMAKE_BUILD_TYPE=Release"
90+
"-DCMAKE_BUILD_TYPE=${CMKR_BUILD_TYPE}"
91+
"-DCMAKE_UNITY_BUILD=ON"
9092
"-DCMAKE_INSTALL_PREFIX=${CMKR_DIRECTORY}"
9193
"-DCMKR_GENERATE_DOCUMENTATION=OFF"
9294
)
9395
cmkr_exec("${CMAKE_COMMAND}"
9496
--build "${CMKR_DIRECTORY}/build"
95-
--config Release
97+
--config "${CMKR_BUILD_TYPE}"
9698
--parallel
9799
)
98100
cmkr_exec("${CMAKE_COMMAND}"
99101
--install "${CMKR_DIRECTORY}/build"
100-
--config Release
102+
--config "${CMKR_BUILD_TYPE}"
101103
--prefix "${CMKR_DIRECTORY}"
102104
--component cmkr
103105
)

0 commit comments

Comments
 (0)