cmake: Map MinSizeRel to ReleaseSmall.

This commit is contained in:
Alex Rønne Petersen 2025-04-16 20:46:41 +02:00
parent 19888f759f
commit f2363623e1
No known key found for this signature in database

View File

@ -943,13 +943,18 @@ set(ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assert
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug) list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug)
else() else()
if(ZIG_RELEASE_SAFE) if("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe) list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSmall)
else() else()
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast) # Release and RelWithDebInfo
endif() if(ZIG_RELEASE_SAFE)
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe)
list(APPEND ZIG_BUILD_ARGS -Dstrip) else()
list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast)
endif()
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
list(APPEND ZIG_BUILD_ARGS -Dstrip)
endif()
endif() endif()
endif() endif()