diff --git a/BuildWasmDockerfile b/BuildWasmDockerfile index a687e14..e4d4266 100644 --- a/BuildWasmDockerfile +++ b/BuildWasmDockerfile @@ -27,7 +27,7 @@ RUN cd /deps/nlohmannjson/build && \ ################################################################## RUN mkdir -p /deps/xeus/build -RUN git clone --branch 5.0.0 https://github.com/jupyter-xeus/xeus.git /deps/xeus/src +RUN git clone --branch main https://github.com/jupyter-xeus/xeus.git /deps/xeus/src #COPY xeus /deps/xeus/src diff --git a/CMakeLists.txt b/CMakeLists.txt index aade34c..edfe6da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ message(STATUS "xeus-lite version: v${XEUS_LITE_VERSION}") # Build options # ============= +option(XEUS_LITE_USE_SHARED_XEUS "Link with the xeus shared library (instead of the static library)" ON) # Test options option(XEUS_LITE_BUILD_NODE_TESTS "xeus-lite test suite (node)" OFF) @@ -49,11 +50,16 @@ endif() # Print build configuration # ========================== -message(STATUS "XEUS_LITE_BUILD_NODE_TESTS: ${XEUS_LITE_BUILD_NODE_TESTS}") +message(STATUS "XEUS_LITE_USE_SHARED_XEUS: ${XEUS_LITE_USE_SHARED_XEUS}") +message(STATUS "XEUS_LITE_BUILD_NODE_TESTS: ${XEUS_LITE_BUILD_NODE_TESTS}") # Dependencies # ============ +if(EMSCRIPTEN AND XEUS_LITE_USE_SHARED_XEUS) + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) +endif() + set(xeus_REQUIRED_VERSION 5.0.0) if (NOT TARGET xeus) @@ -86,10 +92,11 @@ target_include_directories( PUBLIC $ $ ) -target_link_libraries( - xeus-lite - PUBLIC xeus-static -) +if(XEUS_LITE_USE_SHARED_XEUS) + target_link_libraries(xeus-lite PUBLIC xeus) +else() + target_link_libraries(xeus-lite PUBLIC xeus-static) +endif() set_target_properties( xeus-lite diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5b68e51..1513e29 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -25,7 +25,7 @@ if(XEUS_LITE_BUILD_BROWSER_TEST_KERNEL) SET(KERNEL_INSTALL_DIR "share/jupyter/kernels/xlite") - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/logo-64x64.png" + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/logo-64x64.png" "${CMAKE_CURRENT_SOURCE_DIR}/logo-32x32.png" "$/xlite.wasm" "$/xlite.js" diff --git a/test/copy_files.sh b/test/copy_files.sh index 1975ba7..270ae25 100755 --- a/test/copy_files.sh +++ b/test/copy_files.sh @@ -2,3 +2,4 @@ set -e cd /xeus-build/test cp *.{js,wasm} /xeus-lite/test +cp /install/lib/libxeus.so /xeus-lite/test