From db324b1fb2cf6c135a130d23bd18ac2dbfc95724 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 22 May 2026 09:26:43 -0700 Subject: [PATCH] Set `BUILD_STATIC_LIB` under emscripten This fixes the following warning when building with emscripten: ``` CMake Warning (dev) at CMakeLists.txt:460 (add_library): ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. This warning is for project developers. Use -Wno-dev to suppress it. ``` --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97863ffb52b..109d5c8f784 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,9 @@ if(EMSCRIPTEN) endif() option(BUILD_STATIC_LIB "Build as a static library" OFF) -if(MSVC) +if(MSVC OR EMSCRIPTEN) # We don't have dllexport declarations set up for Windows yet. + # With emscripten we require a static library to create binaryen_js correctly. set(BUILD_STATIC_LIB ON) endif()