Skip to content

Commit

Permalink
Update Emscripten build configuration
Browse files Browse the repository at this point in the history
Removed `.mjs` extension and added TypeScript definition generation for the Emscripten build. This change ensures compatibility with web environments and improves developer experience with TypeScript by generating the `OasisC.d.ts` file.
  • Loading branch information
matthew-mccall committed Aug 15, 2024
1 parent 7a49bf6 commit 02334d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ set(OasisC_SOURCES

if (DEFINED EMSCRIPTEN)
add_executable(OasisC ${OasisC_SOURCES})
set(CMAKE_EXECUTABLE_SUFFIX ".mjs")
target_link_options(OasisC PUBLIC -sSINGLE_FILE --no-entry "-sEXPORT_NAME='OasisC'" "-sEXPORTED_RUNTIME_METHODS=ccall,cwrap")
target_link_options(OasisC PUBLIC -sSINGLE_FILE --no-entry "-sEXPORT_NAME='OasisC'" "-sEXPORTED_RUNTIME_METHODS=ccall,cwrap" "-sENVIRONMENT='web'" "--emit-tsd OasisC.d.ts")
else ()
add_library(OasisC ${OasisC_SOURCES})
endif ()
Expand Down

0 comments on commit 02334d7

Please sign in to comment.