Skip to content

Commit f236362

Browse files
committed
cmake: Map MinSizeRel to ReleaseSmall.
1 parent 19888f7 commit f236362

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -943,13 +943,18 @@ set(ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assert
943943
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
944944
list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug)
945945
else()
946-
if(ZIG_RELEASE_SAFE)
947-
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe)
946+
if("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
947+
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSmall)
948948
else()
949-
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast)
950-
endif()
951-
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
952-
list(APPEND ZIG_BUILD_ARGS -Dstrip)
949+
# Release and RelWithDebInfo
950+
if(ZIG_RELEASE_SAFE)
951+
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe)
952+
else()
953+
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast)
954+
endif()
955+
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
956+
list(APPEND ZIG_BUILD_ARGS -Dstrip)
957+
endif()
953958
endif()
954959
endif()
955960

0 commit comments

Comments
 (0)