Skip to content
Snippets Groups Projects
Unverified Commit 2c84a98b authored by René Fritze's avatar René Fritze
Browse files

[cmake] optionally prevent linking python lib

this is necessary for manylinux toolchains where there's no
linkable libpython
parent cabe1942
No related branches found
No related tags found
1 merge request!63Wheel building tweaks
Pipeline #67684 passed
...@@ -82,7 +82,9 @@ elseif(APPLE) ...@@ -82,7 +82,9 @@ elseif(APPLE)
target_link_libraries(dunepybindximodule INTERFACE "-undefined dynamic_lookup") target_link_libraries(dunepybindximodule INTERFACE "-undefined dynamic_lookup")
endif() endif()
target_link_libraries(dunepybindxiembed INTERFACE pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>) if(NOT DXT_DONT_LINK_PYTHON_LIB)
target_link_libraries(dunepybindxiembed INTERFACE pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
endif()
add_library(pybind11::embed ALIAS dunepybindxiembed) add_library(pybind11::embed ALIAS dunepybindxiembed)
target_link_libraries(dunepybindxi dunepybindxiembed) target_link_libraries(dunepybindxi dunepybindxiembed)
......
...@@ -148,7 +148,7 @@ function(dune_pybindxi_add_module target_name) ...@@ -148,7 +148,7 @@ function(dune_pybindxi_add_module target_name)
set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden") set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${target_name} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) set_target_properties(${target_name} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
if(WIN32 OR CYGWIN) if(NOT DXT_DONT_LINK_PYTHON_LIB AND (WIN32 OR CYGWIN))
# Link against the Python shared library on Windows # Link against the Python shared library on Windows
target_link_libraries(${target_name} ${PYTHON_LIBRARIES}) target_link_libraries(${target_name} ${PYTHON_LIBRARIES})
elseif(APPLE) elseif(APPLE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment