-
Notifications
You must be signed in to change notification settings - Fork 5
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
[WIP] fixes to build for WASM #76
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,27 @@ if (CMAKE_COMPILER_IS_GNUCXX) | |
endif() | ||
|
||
message(STATUS "Looking for python ...") | ||
set(Python_FIND_VIRTUALENV ONLY) | ||
find_package (Python COMPONENTS Interpreter Development) | ||
if (NOT Python_FOUND) | ||
set(Python_FIND_VIRTUALENV STANDARD) | ||
find_package (Python COMPONENTS Interpreter Development) | ||
endif() | ||
|
||
if (NOT Python_Development_FOUND) | ||
message(FATAL_ERROR "Python development package not found and python component required") | ||
if(NOT EMSCRIPTEN) | ||
set(Python_FIND_VIRTUALENV ONLY) | ||
find_package (Python COMPONENTS Interpreter Development) | ||
if (NOT Python_FOUND) | ||
set(Python_FIND_VIRTUALENV STANDARD) | ||
find_package (Python COMPONENTS Interpreter Development) | ||
endif() | ||
|
||
if (NOT Python_Development_FOUND) | ||
message(FATAL_ERROR "Python development package not found and python component required") | ||
endif() | ||
else() | ||
set(Python_INCLUDE_DIRS | ||
"${CMAKE_PREFIX_PATH}/include/python3.11" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't want |
||
) | ||
|
||
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) | ||
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1") | ||
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1") | ||
set(CMAKE_STRIP FALSE) | ||
endif() | ||
|
||
include_directories("${PROJECT_SOURCE_DIR}/include" "${Python_INCLUDE_DIRS}") | ||
|
@@ -28,6 +40,12 @@ file (GLOB cppyy_src src/*.cxx) | |
|
||
add_library(cppyy SHARED ${cppyy_src}) | ||
|
||
if (EMSCRIPTEN) | ||
target_link_options(cppyy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer set_target_properties and to use the link_flags option, and we can drop the |
||
PUBLIC "SHELL: -s WASM_BIGINT" | ||
) | ||
endif() | ||
|
||
if(APPLE) | ||
set_target_properties(cppyy PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") | ||
set_target_properties(cppyy PROPERTIES SUFFIX ".so") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather have if (emscripten) then else as that is more clear