Skip to content

Commit 951e670

Browse files
authored
Fix the case where there is an @ in the absolute path of sysroot and XEUS_CPP_RESOURCE_DIR in Emscripten build (#333)
1 parent 5f41b15 commit 951e670

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,12 @@ if(EMSCRIPTEN)
446446
xeus_cpp_set_kernel_options(xcpp)
447447
xeus_wasm_compile_options(xcpp)
448448
xeus_wasm_link_options(xcpp "web,worker")
449+
string(REPLACE "@" "@@" ESCAPED_SYSROOT_PATH "${SYSROOT_PATH}")
450+
string(REPLACE "@" "@@" ESCAPED_XEUS_CPP_RESOURCE_DIR "${XEUS_CPP_RESOURCE_DIR}")
449451
target_link_options(xcpp
450452
PUBLIC "SHELL: -s USE_SDL=2"
451-
PUBLIC "SHELL: --preload-file ${SYSROOT_PATH}/include@/include"
452-
PUBLIC "SHELL: --preload-file ${XEUS_CPP_RESOURCE_DIR}@/${CMAKE_INSTALL_LIBDIR}/clang/${CPPINTEROP_LLVM_VERSION_MAJOR}"
453+
PUBLIC "SHELL: --preload-file ${ESCAPED_SYSROOT_PATH}/include@/include"
454+
PUBLIC "SHELL: --preload-file ${ESCAPED_XEUS_CPP_RESOURCE_DIR}@/${CMAKE_INSTALL_LIBDIR}/clang/${CPPINTEROP_LLVM_VERSION_MAJOR}"
453455
PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_SOURCE_DIR}/wasm_patches/post.js"
454456
)
455457
endif()

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if(EMSCRIPTEN)
7575
PUBLIC "SHELL: -s EXIT_RUNTIME=1"
7676
PUBLIC "SHELL: -s STACK_SIZE=32mb"
7777
PUBLIC "SHELL: -s INITIAL_MEMORY=128mb"
78-
PUBLIC "SHELL: --preload-file ${SYSROOT_PATH}/include@/include"
78+
PUBLIC "SHELL: --preload-file ${ESCAPED_SYSROOT_PATH}/include@/include"
7979
PUBLIC "SHELL: --preload-file ../${XEUS_CPP_DATA_DIR}@/share/xeus-cpp"
8080
PUBLIC "SHELL: --preload-file ../${XEUS_CPP_CONF_DIR}@/etc/xeus-cpp"
8181
PUBLIC "SHELL: --emrun"

0 commit comments

Comments
 (0)