diff --git a/CMakeLists.txt b/CMakeLists.txt index 18c09b2..76530f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,7 @@ if (${IS_GNU} OR ${IS_CLANG}) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize -fno-math-errno") include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Oz" Z_OPTIMIZATION_SUPPORTED) - if (Z_OPTIMIZATION_SUPPORTED) + if (Z_OPTIMIZATION_SUPPORTED OR EMSCRIPTEN) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Oz") endif() set(CF_PROTECTION "-fcf-protection")