Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ if(EMSCRIPTEN)
xeus_wasm_link_options(xcpp "web,worker")
# TODO: Remove the exported runtime methods
# after the next xeus release.
target_link_options(xcpp PUBLIC
-sEXPORTED_RUNTIME_METHODS=FS,PATH,ERRNO_CODES
# add sysroot location here
--preload-file ${SYSROOT_PATH}/include@/include
target_link_options(xcpp
PUBLIC "SHELL: -s EXPORTED_RUNTIME_METHODS='[\"FS\",\"PATH\",\"LDSO\",\"loadDynamicLibrary\",\"ERRNO_CODES\"]'"
PUBLIC "SHELL: --preload-file ${SYSROOT_PATH}/include@/include"
PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_SOURCE_DIR}/wasm_patches/post.js"
)
# TODO: Emscripten supports preloading files just once before it generates
# the xcpp.data file (containing the binary representation of the file(s) we
Expand Down
12 changes: 12 additions & 0 deletions wasm_patches/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if (!('wasmTable' in Module)) {
Module.wasmTable = wasmTable
}

Module.FS = FS
Module.PATH = PATH
Module.LDSO = LDSO
Module.getDylinkMetadata = getDylinkMetadata
Module.loadDynamicLibrary = loadDynamicLibrary

Module.UTF8ToString = UTF8ToString;
Module.ERRNO_CODES = ERRNO_CODES;
Loading