CMakeLists.txt: Always use the "-Oz" optimization flag on emscripten since it uses clang

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2023-04-10 15:20:51 +02:00
parent 7c179ea072
commit 97f87e6822
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -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") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize -fno-math-errno")
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Oz" Z_OPTIMIZATION_SUPPORTED) 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") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Oz")
endif() endif()
set(CF_PROTECTION "-fcf-protection") set(CF_PROTECTION "-fcf-protection")