From f2363623e1eb4c0b12b9a8f795e5ce02053ec1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 16 Apr 2025 20:46:41 +0200 Subject: [PATCH] cmake: Map MinSizeRel to ReleaseSmall. --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc6b714ef9..eb31d1ac93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -943,13 +943,18 @@ set(ZIG_RELEASE_SAFE OFF CACHE BOOL "Build Zig as ReleaseSafe (with debug assert if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") list(APPEND ZIG_BUILD_ARGS -Doptimize=Debug) else() - if(ZIG_RELEASE_SAFE) - list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe) + if("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel") + list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSmall) else() - list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseFast) - endif() - if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") - list(APPEND ZIG_BUILD_ARGS -Dstrip) + # Release and RelWithDebInfo + if(ZIG_RELEASE_SAFE) + list(APPEND ZIG_BUILD_ARGS -Doptimize=ReleaseSafe) + 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()