File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ if(PYTHON_IS_DEBUG)
115
115
PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)
116
116
endif ()
117
117
118
+ # The <3.11 code here does not support release/debug builds at the same time, like on vcpkg
118
119
if (CMAKE_VERSION VERSION_LESS 3.11)
119
120
set_property (
120
121
TARGET pybind11::module
@@ -130,16 +131,19 @@ if(CMAKE_VERSION VERSION_LESS 3.11)
130
131
APPEND
131
132
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES} >)
132
133
else ()
134
+ # The IMPORTED INTERFACE library here is to ensure that "debug" and "release" get processed outside
135
+ # of a generator expression - https://gitlab.kitware.com/cmake/cmake/-/issues/18424, as they are
136
+ # target_link_library keywords rather than real libraries.
137
+ add_library (pybind11::_ClassicPythonLibraries IMPORTED INTERFACE )
138
+ target_link_libraries (pybind11::_ClassicPythonLibraries INTERFACE ${PYTHON_LIBRARIES} )
133
139
target_link_libraries (
134
140
pybind11::module
135
141
INTERFACE
136
142
pybind11::python_link_helper
137
- "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES} >>"
138
- )
143
+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:pybind11::_ClassicPythonLibraries>" )
139
144
140
145
target_link_libraries (pybind11::embed INTERFACE pybind11::pybind11
141
- $<BUILD_INTERFACE:${PYTHON_LIBRARIES} >)
142
-
146
+ pybind11::_ClassicPythonLibraries)
143
147
endif ()
144
148
145
149
function (pybind11_extension name )
You can’t perform that action at this time.
0 commit comments