From 80576c721dcbffad476e518eb1cd98d0e92cc916 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 4 May 2024 19:07:30 +0200 Subject: [PATCH] c-api: use `--release` when MinSizeRel and RelWithDebInfo is used (#8549) --- crates/c-api/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/c-api/CMakeLists.txt b/crates/c-api/CMakeLists.txt index 16b186f243..1bface8452 100644 --- a/crates/c-api/CMakeLists.txt +++ b/crates/c-api/CMakeLists.txt @@ -5,7 +5,10 @@ set(WASMTIME_USER_CARGO_BUILD_OPTIONS "" CACHE STRING "Additional cargo flags (s option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) option(WASMTIME_ALWAYS_BUILD "If cmake should always invoke cargo to build wasmtime" ON) -if(CMAKE_BUILD_TYPE STREQUAL "Release") +if(CMAKE_BUILD_TYPE STREQUAL "Release" OR + CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" OR + CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" +) set(WASMTIME_BUILD_TYPE_FLAG "--release") set(WASMTIME_BUILD_TYPE "release") else()