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

changes required for emscripten-3.173 #84

Merged
merged 4 commits into from
Jan 7, 2025
Merged
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
50 changes: 23 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ if (NOT DEFINED PY_VERSION)
set(PY_VERSION 3.11)
endif()


file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pycpp_includes)




##########################################################
# generate prejs and postjs
##########################################################
Expand Down Expand Up @@ -70,9 +66,6 @@ add_custom_command(OUTPUT "pyjs_post.js"
DEPENDS ${POSTJS_FILES})





##########################################################
# headers to install
##########################################################
Expand Down Expand Up @@ -117,21 +110,19 @@ add_library(pyjs STATIC

target_link_libraries(pyjs PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed)

target_compile_options(pyjs
PUBLIC --std=c++17
PUBLIC -Wno-deprecated
PUBLIC "SHELL: -fexceptions"
)

target_compile_options(pyjs
PUBLIC --std=c++17
PUBLIC -Wno-deprecated
PUBLIC "SHELL: -fexceptions"
)

target_link_options(pyjs
PUBLIC -lembind
PUBLIC -Wno-unused-command-line-argument
PUBLIC "SHELL: -fexceptions"
#PUBLIC "SHELL:-s EXPORT_EXCEPTION_HANDLING_HELPERS"
#PUBLIC "SHELL:-s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules']"
)

target_link_options(pyjs
PRIVATE -lembind
PUBLIC -Wno-unused-command-line-argument
PUBLIC "SHELL: -fexceptions"
#PUBLIC "SHELL:-s EXPORT_EXCEPTION_HANDLING_HELPERS"
#PUBLIC "SHELL:-s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules']"
)


set_target_properties(pyjs PROPERTIES
Expand All @@ -144,10 +135,11 @@ add_dependencies(pyjs merge_pyjs)
target_link_libraries(pyjs PRIVATE pybind11::pybind11)
target_compile_options(pyjs PRIVATE -fPIC)


target_include_directories(pyjs
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include> # <prefix>/include
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

SET(PYTHON_UTIL_LIBS
Expand Down Expand Up @@ -180,16 +172,19 @@ target_compile_definitions(pyjs_runtime_browser PUBLIC -DPYTEST_DRIVER_WEB)
target_include_directories(pyjs_runtime_browser
PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/pycpp_includes)
${CMAKE_CURRENT_BINARY_DIR}/pycpp_includes
${ZLIB_INCLUDE_DIRS}
)

set_target_properties(pyjs_runtime_browser
PROPERTIES
CXX_STANDARD 17
)
target_compile_definitions(pyjs_runtime_browser PUBLIC -DPYJS_WEB)
target_compile_options(pyjs_runtime_browser PRIVATE -fPIC)
target_link_libraries(pyjs_runtime_browser PRIVATE pyjs)
target_link_libraries(pyjs_runtime_browser PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed)
target_link_libraries(pyjs_runtime_browser PRIVATE pyjs pybind11::embed ${PYTHON_UTIL_LIBS})



target_compile_options(pyjs_runtime_browser
PUBLIC --std=c++17
Expand All @@ -204,6 +199,7 @@ target_compile_options(pyjs_runtime_browser
)

target_link_options(pyjs_runtime_browser
PRIVATE -lembind
PUBLIC -Wno-unused-command-line-argument
PUBLIC "SHELL: -s MODULARIZE=1"
PUBLIC "SHELL: -s EXPORT_NAME=\"createModule\""
Expand Down
Loading