File tree Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Expand file tree Collapse file tree 1 file changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -115,17 +115,32 @@ if(PYTHON_IS_DEBUG)
115115 PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)
116116endif ()
117117
118- set_property (
119- TARGET pybind11::module
120- APPEND
121- PROPERTY
122- INTERFACE_LINK_LIBRARIES pybind11::python_link_helper
123- "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES} >>" )
118+ if (CMAKE_VERSION VERSION_LESS 3.11)
119+ set_property (
120+ TARGET pybind11::module
121+ APPEND
122+ PROPERTY
123+ INTERFACE_LINK_LIBRARIES
124+ pybind11::python_link_helper
125+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES} >>"
126+ )
124127
125- set_property (
126- TARGET pybind11::embed
127- APPEND
128- PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES} >)
128+ set_property (
129+ TARGET pybind11::embed
130+ APPEND
131+ PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES} >)
132+ else ()
133+ target_link_libraries (
134+ pybind11::module
135+ INTERFACE
136+ pybind11::python_link_helper
137+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES} >>"
138+ )
139+
140+ target_link_libraries (pybind11::embed INTERFACE pybind11::pybind11
141+ $<BUILD_INTERFACE:${PYTHON_LIBRARIES} >)
142+
143+ endif ()
129144
130145function (pybind11_extension name )
131146 # The prefix and extension are provided by FindPythonLibsNew.cmake
You can’t perform that action at this time.
0 commit comments