From bbe8b4941eaab3ee031080da459aeceb66747652 Mon Sep 17 00:00:00 2001 From: Matthew McCall Date: Wed, 28 Aug 2024 20:41:51 -0400 Subject: [PATCH] Convert EMSCRIPTEN build target to an OBJECT library Previously, the EMSCRIPTEN build target was an executable, which is not ideal for modular code reuse. Changing it to an OBJECT library facilitates better modularization and allows for more flexibility in linking with other targets. This update preserves existing library settings and options. --- CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45f3db9..7b91a4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,14 +12,7 @@ set(OasisC_SOURCES src/Divide.cpp) if (DEFINED EMSCRIPTEN) - add_executable(OasisC ${OasisC_SOURCES}) - target_link_libraries(OasisC PUBLIC embind) - target_link_options(OasisC PUBLIC - --no-entry - "-sSINGLE_FILE" - "-sEXPORTED_RUNTIME_METHODS=ccall,cwrap" - "-sENVIRONMENT='web'" - "--emit-tsd OasisC.d.ts") + add_library(OasisC OBJECT ${OasisC_SOURCES}) else () add_library(OasisC ${OasisC_SOURCES}) endif ()