Skip to content

Commit 7acb89a

Browse files
committed
Fix the case where there is an @ in the absolute path of sysroot and XEUS_CPP_RESOURCE_DIR in Emscripten build
1 parent a236b3b commit 7acb89a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,19 @@ if(EMSCRIPTEN)
445445
xeus_cpp_set_kernel_options(xcpp)
446446
xeus_wasm_compile_options(xcpp)
447447
xeus_wasm_link_options(xcpp "web,worker")
448+
if (SYSROOT_PATH MATCHES "@")
449+
execute_process(
450+
COMMAND ln -s ${SYSROOT_PATH}
451+
)
452+
set(SYSROOT_PATH_ORIGINAL ${SYSROOT_PATH})
453+
set(SYSROOT_PATH "./sysroot/")
454+
endif()
455+
if (XEUS_CPP_RESOURCE_DIR MATCHES "@")
456+
execute_process(
457+
COMMAND ln -s ${XEUS_CPP_RESOURCE_DIR}
458+
)
459+
set(XEUS_CPP_RESOURCE_DIR "./${CPPINTEROP_LLVM_VERSION_MAJOR}")
460+
endif()
448461
target_link_options(xcpp
449462
PUBLIC "SHELL: -s USE_SDL=2"
450463
PUBLIC "SHELL: --preload-file ${SYSROOT_PATH}/include@/include"
@@ -459,6 +472,11 @@ endif()
459472

460473
if(XEUS_CPP_BUILD_TESTS)
461474
add_subdirectory(test)
475+
if (SYSROOT_PATH_ORIGINAL MATCHES "@")
476+
execute_process(
477+
COMMAND ln -s ${SYSROOT_PATH_ORIGINAL} "${CMAKE_CURRENT_BINARY_DIR}/test/"
478+
)
479+
endif()
462480
endif()
463481

464482
# Installation

0 commit comments

Comments
 (0)