mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
fix(cmake): support release and debug at the same time (#3948)
This commit is contained in:
parent
a8b3ff30f9
commit
1e4bd22bdc
@ -115,17 +115,32 @@ if(PYTHON_IS_DEBUG)
|
|||||||
PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)
|
PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(
|
if(CMAKE_VERSION VERSION_LESS 3.11)
|
||||||
TARGET pybind11::module
|
set_property(
|
||||||
APPEND
|
TARGET pybind11::module
|
||||||
PROPERTY
|
APPEND
|
||||||
INTERFACE_LINK_LIBRARIES pybind11::python_link_helper
|
PROPERTY
|
||||||
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>")
|
INTERFACE_LINK_LIBRARIES
|
||||||
|
pybind11::python_link_helper
|
||||||
|
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>"
|
||||||
|
)
|
||||||
|
|
||||||
set_property(
|
set_property(
|
||||||
TARGET pybind11::embed
|
TARGET pybind11::embed
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
|
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
|
||||||
|
else()
|
||||||
|
target_link_libraries(
|
||||||
|
pybind11::module
|
||||||
|
INTERFACE
|
||||||
|
pybind11::python_link_helper
|
||||||
|
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(pybind11::embed INTERFACE pybind11::pybind11
|
||||||
|
$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
function(pybind11_extension name)
|
function(pybind11_extension name)
|
||||||
# The prefix and extension are provided by FindPythonLibsNew.cmake
|
# The prefix and extension are provided by FindPythonLibsNew.cmake
|
||||||
|
Loading…
Reference in New Issue
Block a user