Skip to content

Commit

Permalink
Merge pull request #593 from DerThorsten/pyjs
Browse files Browse the repository at this point in the history
pyjs 1.3.2
  • Loading branch information
JohanMabille committed Sep 25, 2023
2 parents f87c29c + c2ad880 commit 3a09178
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
strategy:
fail-fast: false
matrix:
emsdk_ver: ["3.1.27"]
emsdk_ver: ["3.1.45"]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
$HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}}
source $HOME/emsdk/emsdk_env.sh
micromamba create -f environment-wasm-host.yml --platform=emscripten-32
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
mkdir build
pushd build
Expand Down
19 changes: 13 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,17 @@ OPTION(XPYT_EMSCRIPTEN_WASM_BUILD "Build for wasm with emscripten" OFF)
# Test options
OPTION(XPYT_BUILD_TESTS "xeus-python test suite" OFF)

function(cat IN_FILE OUT_FILE)
file(READ ${IN_FILE} CONTENTS)
file(APPEND ${OUT_FILE} "\n${CONTENTS}")
endfunction()


if(XPYT_EMSCRIPTEN_WASM_BUILD)
configure_file(wasm_patches/post.js ${CMAKE_CURRENT_BINARY_DIR}/post.js COPYONLY)
# Prepare a temporary file to "post.js.in" to
# merge xeus custom post js and the pyjs post js
file(WRITE post.js.in "")
cat(wasm_patches/post.js post.js.in)

add_compile_definitions(XPYT_EMSCRIPTEN_WASM_BUILD)

Expand All @@ -92,7 +101,7 @@ set(xeus-zmq_REQUIRED_VERSION 1.0.1)
set(xeus-lite_REQUIRED_VERSION 1.0.1)
set(pybind11_REQUIRED_VERSION 2.6.1)
set(pybind11_json_REQUIRED_VERSION 0.2.8)
set(pyjs_REQUIRED_VERSION 1.0.0)
set(pyjs_REQUIRED_VERSION 1.3.2)

if (NOT TARGET xtl)
find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED)
Expand All @@ -112,10 +121,8 @@ if(XPYT_EMSCRIPTEN_WASM_BUILD)
find_package(pyjs ${pyjs_REQUIRED_VERSION} REQUIRED)
endif ()
configure_file(${pyjs_PRE_JS_PATH} ${CMAKE_CURRENT_BINARY_DIR}/pre.js COPYONLY)
# we can ignore this file, as the xeus-specific post.js contains everything from
# TODO Move the post.js/pre.js from pyjs that is not specific to Python in xeus-lite
# pyjs post.js
# configure_file(${pyjs_POST_JS_PATH} ${CMAKE_CURRENT_BINARY_DIR}/post.js COPYONLY)
cat(${pyjs_POST_JS_PATH} post.js.in)
configure_file( post.js.in ${CMAKE_CURRENT_BINARY_DIR}/post.js COPYONLY)
else ()
if (NOT TARGET xeus-zmq AND NOT TARGET xeus-zmq-static)
find_package(xeus-zmq ${xeus-zmq_REQUIRED_VERSION} REQUIRED)
Expand Down

0 comments on commit 3a09178

Please sign in to comment.