Skip to content

Commit

Permalink
Python: add_library -> Python_add_library
Browse files Browse the repository at this point in the history
Using this function implements a fallback for systems where no static
library support exists.

Examples: old Cray systems and emscripten (WebAssembly).
  • Loading branch information
ax3l committed Feb 14, 2022
1 parent 70a52de commit c4128ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if(DEFINED BUILD_SHARED_LIBS)
else()
set(openPMD_BUILD_SHARED_LIBS_DEFAULT ${SHARED_LIBS_SUPPORTED})
endif()
option(openPMD_BUILD_SHARED_LIBS "Build the openPMD tests"
option(openPMD_BUILD_SHARED_LIBS "Build shared openPMD libraries"
${openPMD_BUILD_SHARED_LIBS_DEFAULT})
if(openPMD_BUILD_SHARED_LIBS AND NOT SHARED_LIBS_SUPPORTED)
message(FATAL_ERROR "openPMD_BUILD_SHARED_LIBS requested but not supported by platform")
Expand Down Expand Up @@ -375,6 +375,9 @@ if(CMAKE_VERSION VERSION_LESS 3.18.0)
# https://cmake.org/cmake/help/v3.18/module/FindPython.html
set(_PY_DEV_MODULE Development)
endif()
if(EMSCRIPTEN)
set(_PY_DEV_MODULE ${_PY_DEV_MODULE} Development.Embed)
endif()
if(openPMD_USE_PYTHON STREQUAL AUTO)
find_package(Python 3.6.0 COMPONENTS Interpreter ${_PY_DEV_MODULE})
if(Python_FOUND)
Expand Down Expand Up @@ -640,7 +643,7 @@ endif()

# python bindings
if(openPMD_HAVE_PYTHON)
add_library(openPMD.py MODULE
Python_add_library(openPMD.py MODULE
src/binding/python/openPMD.cpp
src/binding/python/Access.cpp
src/binding/python/Attributable.cpp
Expand Down

0 comments on commit c4128ab

Please sign in to comment.