vcpkg/ports/pybind11/fix-usage.patch
Jack·Boos·Yu 8a23d2e124
[pybind11] Fix usage (#26239)
* [pybind11] Fix usage

* version
2022-08-09 11:56:06 -07:00

25 lines
1.0 KiB
Diff

diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake
index 5535e87..6576b2e 100644
--- a/tools/pybind11Tools.cmake
+++ b/tools/pybind11Tools.cmake
@@ -130,15 +130,16 @@ if(CMAKE_VERSION VERSION_LESS 3.11)
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
else()
+ add_library(pybind11::_ClassicPythonLibraries IMPORTED INTERFACE)
+ target_link_libraries(pybind11::_ClassicPythonLibraries INTERFACE ${PYTHON_LIBRARIES})
target_link_libraries(
pybind11::module
INTERFACE
pybind11::python_link_helper
- "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>"
- )
+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:pybind11::_ClassicPythonLibraries>")
target_link_libraries(pybind11::embed INTERFACE pybind11::pybind11
- $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
+ pybind11::_ClassicPythonLibraries)
endif()