diff --git a/CMakeLists.txt b/CMakeLists.txt index cc8289d..7aaf435 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,7 @@ option(USE_SIMD_FALLBACK # https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/third_party/valgrind) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options($<$:-Wno-invalid-offsetof>) -endif() +add_compile_options($<$:-Wno-invalid-offsetof>) if(APPLE) add_link_options(-Wl,-dead_strip) @@ -45,21 +43,17 @@ endif() if(EMSCRIPTEN) # https://github.com/emscripten-core/emscripten/issues/15377#issuecomment-1285167486 add_link_options(-lnodefs.js -lnoderawfs.js) + add_link_options(-s ALLOW_MEMORY_GROWTH) endif() include(CheckIncludeFileCXX) include(CMakePushCheckState) if(NOT USE_SIMD_FALLBACK) - cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_FLAGS -msimd128) - check_include_file_cxx("wasm_simd128.h" HAS_WASM_SIMD) - if(HAS_WASM_SIMD) + if(EMSCRIPTEN) # https://emscripten.org/docs/porting/simd.html#using-simd-with-webassembly add_compile_options(-msimd128) - add_compile_definitions(HAS_WASM_SIMD) endif() - cmake_pop_check_state() cmake_push_check_state() list(APPEND CMAKE_REQUIRED_FLAGS -mavx)