Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make wasm build more consistent #605

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading