| ... | ... | @@ -951,12 +951,24 @@ if(ZIG_EXTRA_BUILD_ARGS) |
| 951 | 951 | list(APPEND ZIG_BUILD_ARGS ${ZIG_EXTRA_BUILD_ARGS}) |
| 952 | 952 | endif() |
| 953 | 953 | |
| 954 | set(ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assertions on)") |
| 955 | |
| 954 | 956 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") |
| 955 | 957 | list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug) |
| 956 | | elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") |
| 957 | | list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast) |
| 958 | 958 | else() |
| 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() |
| 960 | 972 | endif() |
| 961 | 973 | |
| 962 | 974 | if(ZIG_STATIC AND NOT MSVC) |