| ... | @@ -938,12 +938,19 @@ if(ZIG_EXTRA_BUILD_ARGS) | ... | @@ -938,12 +938,19 @@ if(ZIG_EXTRA_BUILD_ARGS) |
| 938 | list(APPEND ZIG_BUILD_ARGS ${ZIG_EXTRA_BUILD_ARGS}) | 938 | list(APPEND ZIG_BUILD_ARGS ${ZIG_EXTRA_BUILD_ARGS}) |
| 939 | endif() | 939 | endif() |
| 940 | | 940 | |
| | 941 | set(ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assertions on)") |
| | 942 | |
| 941 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") | 943 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") |
| 942 | list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug) | 944 | list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug) |
| 943 | elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") | | |
| 944 | list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast) | | |
| 945 | else() | 945 | else() |
| 946 | list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast -Dstrip) | 946 | if(ZIG_RELEASE_SAFE) |
| | 947 | list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe) |
| | 948 | 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) |
| | 953 | endif() |
| 947 | endif() | 954 | endif() |
| 948 | | 955 | |
| 949 | if(ZIG_STATIC AND NOT MSVC) | 956 | if(ZIG_STATIC AND NOT MSVC) |