File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -951,12 +951,24 @@ if(ZIG_EXTRA_BUILD_ARGS)
951951 list (APPEND ZIG_BUILD_ARGS ${ZIG_EXTRA_BUILD_ARGS} )
952952endif ()
953953
954+ set (ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assertions on)" )
955+
954956if ("${CMAKE_BUILD_TYPE} " STREQUAL "Debug" )
955957 list (APPEND ZIG_BUILD_ARGS -Doptimize=Debug)
956- elseif ("${CMAKE_BUILD_TYPE} " STREQUAL "RelWithDebInfo" )
957- list (APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast)
958958else ()
959- list (APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast -Dstrip)
959+ if ("${CMAKE_BUILD_TYPE} " STREQUAL "MinSizeRel" )
960+ list (APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSmall)
961+ else ()
962+ # Release and RelWithDebInfo
963+ if (ZIG_RELEASE_SAFE)
964+ list (APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe)
965+ else ()
966+ list (APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast)
967+ endif ()
968+ if (NOT "${CMAKE_BUILD_TYPE} " STREQUAL "RelWithDebInfo" )
969+ list (APPEND ZIG_BUILD_ARGS -Dstrip)
970+ endif ()
971+ endif ()
960972endif ()
961973
962974if (ZIG_STATIC AND NOT MSVC )
You can’t perform that action at this time.
0 commit comments