Skip to content

Commit

Permalink
make wasm build more consistent (#605)
Browse files Browse the repository at this point in the history
* consitency

* drop wasm patches

* re-adding
  • Loading branch information
DerThorsten authored Dec 7, 2023
1 parent d176d4c commit c935c5f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 35 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,4 @@ jobs:
..
make -j5
popd
# Patch output
python wasm_patches/patch_it.py
- uses: actions/upload-artifact@v2
with:
name: xeus-python-wasm
path: |
build/xpython_wasm.js
build/xpython_wasm.wasm
27 changes: 14 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ if (XPYT_BUILD_XPYTHON_EXTENSION)
xpyt_target_link_libraries(xpython_extension)
endif()

# xpython_wasm
# xpython
# ============

if (EMSCRIPTEN)
Expand All @@ -410,19 +410,19 @@ if (EMSCRIPTEN)
$ENV{PREFIX}/lib/libffi.a
)

add_executable(xpython_wasm ${XPYTHON_WASM_SRC})
target_link_libraries(xpython_wasm PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed)
add_executable(xpython ${XPYTHON_WASM_SRC})
target_link_libraries(xpython PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed)

xpyt_set_common_options(xpython_wasm)
target_compile_options(xpython_wasm PRIVATE -fPIC)
xpyt_set_common_options(xpython)
target_compile_options(xpython PRIVATE -fPIC)

xpyt_set_kernel_options(xpython_wasm)
target_link_libraries(xpython_wasm PRIVATE xeus-python-wasm xeus-lite)
xpyt_set_kernel_options(xpython)
target_link_libraries(xpython PRIVATE xeus-python-wasm xeus-lite)

include(WasmBuildOptions)
xeus_wasm_compile_options(xpython_wasm)
xeus_wasm_link_options(xpython_wasm "web,worker")
target_link_options(xpython_wasm
xeus_wasm_compile_options(xpython)
xeus_wasm_link_options(xpython "web,worker")
target_link_options(xpython
PUBLIC "SHELL: -s LZ4=1"
PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_BINARY_DIR}/post.js"
PUBLIC "SHELL: --pre-js pre.js"
Expand Down Expand Up @@ -513,8 +513,9 @@ endif ()
if (EMSCRIPTEN)

install(FILES
"$<TARGET_FILE_DIR:xpython_wasm>/xpython_wasm.js"
"$<TARGET_FILE_DIR:xpython_wasm>/xpython_wasm.wasm"
DESTINATION ${XJUPYTER_DATA_DIR}/kernels/xpython/
"$<TARGET_FILE_DIR:xpython>/xpython.js"
"$<TARGET_FILE_DIR:xpython>/xpython.wasm"
DESTINATION ${CMAKE_INSTALL_BINDIR}
)

endif ()
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xpython/kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"{connection_file}"
],
"language": "python",
"metadata": { "debugger": true, "wasm_name" : "xpython_wasm"}
"metadata": { "debugger": true}
}
9 changes: 0 additions & 9 deletions wasm_patches/patch_it.py

This file was deleted.

0 comments on commit c935c5f

Please sign in to comment.