File tree Expand file tree Collapse file tree 3 files changed +42
-19
lines changed
recipes/recipes_emscripten/xeus Expand file tree Collapse file tree 3 files changed +42
-19
lines changed Original file line number Diff line number Diff line change 22mkdir build
33cd build
44
5- if [[ $target_platform == " emscripten-wasm32" ]]; then
6- export USE_WASM=ON
7- else
8- export USE_WASM=OFF
9- fi
10-
115# Configure step
12- cmake ${CMAKE_ARGS} .. \
13- -GNinja \
14- -DCMAKE_BUILD_TYPE=Release \
15- -DCMAKE_PREFIX_PATH=$PREFIX \
6+ emcmake cmake .. \
7+ -DCMAKE_BUILD_TYPE=Release \
8+ -DCMAKE_PREFIX_PATH=$PREFIX \
169 -DCMAKE_INSTALL_PREFIX=$PREFIX \
17- -DXEUS_EMSCRIPTEN_WASM_BUILD=$USE_WASM \
18- -DCMAKE_FIND_DEBUG_MODE=OFF \
19-
20- # -Dnlohmann_json_DIR=$PREFIX/lib/cmake/nlohmann_json \
21- # -Dxtl_DIR=$PREFIX/share/cmake/xtl \
10+ -DCMAKE_FIND_ROOT_PATH=$PREFIX \
11+ -DXEUS_BUILD_SHARED_LIBS=ON \
12+ -DXEUS_BUILD_STATIC_LIBS=ON
2213
23- # Build step
24- ninja install
14+ # Build & Install step
15+ emmake make -j8 install
Original file line number Diff line number Diff line change 1+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2+ index a8147d3..12cee40 100644
3+ --- a/CMakeLists.txt
4+ +++ b/CMakeLists.txt
5+ @@ -59,8 +59,12 @@ option(XEUS_BUILD_TESTS "xeus test suite" OFF)
6+ # ===================================
7+
8+ if(EMSCRIPTEN)
9+ - SET(XEUS_BUILD_SHARED_LIBS OFF)
10+ - SET(XEUS_BUILD_STATIC_LIBS ON)
11+ + if (XEUS_BUILD_SHARED_LIBS)
12+ + set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
13+ + set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1")
14+ + set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1")
15+ + set(CMAKE_STRIP FALSE)
16+ + endif ()
17+ endif()
18+
19+ # Print build configuration
20+ @@ -258,6 +262,9 @@ macro(xeus_create_target target_name linkage output_name)
21+
22+ if (EMSCRIPTEN)
23+ target_compile_definitions(${target_name} PRIVATE XEUS_EMSCRIPTEN_WASM_BUILD)
24+ + if (XEUS_BUILD_SHARED_LIBS)
25+ + set_target_properties(${target_name} PROPERTIES NO_SONAME 1)
26+ + endif ()
27+ xeus_wasm_compile_options(${target_name})
28+ endif()
29+ endmacro()
Original file line number Diff line number Diff line change @@ -8,21 +8,24 @@ package:
88source :
99 url : https://github.com/jupyter-xeus/xeus/archive/refs/tags/${{ version }}.tar.gz
1010 sha256 : c94008416ae5a54b1fee80a004ecea70cd041e6bd5942e6acebcb878b96c1ec1
11+ patches :
12+ - patches/shared.patch
1113
1214build :
13- number : 0
15+ number : 1
1416
1517requirements :
1618 build :
1719 - ${{ compiler("cxx") }}
1820 - cmake
19- - ninja
21+ - make
2022 host :
2123 - nlohmann_json
2224
2325tests :
2426- script :
2527 - test -f $PREFIX/lib/libxeus.a
28+ - test -f $PREFIX/lib/libxeus.so
2629 - test -f $PREFIX/include/xeus/xeus.hpp
2730about :
2831 license : BSD-3-Clause
You can’t perform that action at this time.
0 commit comments