From e1ee0aee1602569b1244d2d098647fa7e941f1c7 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Mon, 12 May 2025 20:22:34 +0100 Subject: [PATCH] Add -s STRICT=1 flag emscripten build --- lib/Interpreter/CMakeLists.txt | 1 + unittests/CppInterOp/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index eccfc39af..dcc024bca 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -129,6 +129,7 @@ if(EMSCRIPTEN) target_link_options(clangCppInterOp PRIVATE "SHELL: -s WASM_BIGINT" PRIVATE "SHELL: -s SIDE_MODULE=1" + PRIVATE "SHELL: -s STRICT=1" PRIVATE "SHELL: ${SYMBOLS_LIST}" ) if (CPPINTEROP_ENABLE_TESTING) diff --git a/unittests/CppInterOp/CMakeLists.txt b/unittests/CppInterOp/CMakeLists.txt index 4cd66e5f2..8a293ce27 100644 --- a/unittests/CppInterOp/CMakeLists.txt +++ b/unittests/CppInterOp/CMakeLists.txt @@ -43,6 +43,7 @@ if(EMSCRIPTEN) # --preload-file ${SYSROOT_PATH}/include@/include: # Preloads the system include directory into the Emscripten virtual filesystem to make headers accessible at runtime. target_link_options(CppInterOpTests + PUBLIC "SHELL: -s STRICT=1" PUBLIC "SHELL: -fexceptions" PUBLIC "SHELL: -s MAIN_MODULE=1" PUBLIC "SHELL: -s WASM_BIGINT" @@ -91,6 +92,7 @@ target_link_libraries(DynamicLibraryManagerTests if(EMSCRIPTEN) # Check explanation of Emscripten-specific link flags for CppInterOpTests above for DynamicLibraryManagerTests as well. target_link_options(DynamicLibraryManagerTests + PUBLIC "SHELL: -s STRICT=1" PUBLIC "SHELL: -s MAIN_MODULE=1" PUBLIC "SHELL: -s WASM_BIGINT" PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1"