Skip to content

Commit c919270

Browse files
committed
fix: only pass known CMake build types to Lake
1 parent 69b8b00 commit c919270

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
855855
set(LAKE_LIB_PREFIX "lib")
856856
endif()
857857

858+
if(${CMAKE_BUILD_TYPE} MATCHES "Debug|Release|RelWithDebInfo|MinSizeRel")
859+
set(CMAKE_BUILD_TYPE_TOML "${CMAKE_BUILD_TYPE}")
860+
else()
861+
set(CMAKE_BUILD_TYPE_TOML "Release")
862+
endif()
863+
858864
if(USE_LAKE)
859865
configure_file(${LEAN_SOURCE_DIR}/lakefile.toml.in ${CMAKE_BINARY_DIR}/lakefile.toml)
860866
# copy for editing

src/lakefile.toml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ bootstrap = true
1010

1111
defaultTargets = ["Init", "Std", "Lean", "Lake", "LakeMain", "Leanc"]
1212

13-
# Ensure that Lake and CMake agree on the build type (e.g., `Release`, `Debug`)
14-
buildType = "${CMAKE_BUILD_TYPE}"
13+
# Have Lake use CMake's build type (e.g., `Release`, `Debug`) where possible
14+
buildType = "${CMAKE_BUILD_TYPE_TOML}"
1515

1616
# The root of all the compiler output directories
1717
buildDir = "${CMAKE_BINARY_DIR}"

0 commit comments

Comments
 (0)