Skip to content

Commit 2a40552

Browse files
authored
Fixed pybind linking in debug build on windows (#4)
1 parent 11eb58e commit 2a40552

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/Dependencies.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,10 @@ message(STATUS "pybind11 include dirs: " "${pybind11_INCLUDE_DIRS}")
11431143
add_library(pybind::pybind11 INTERFACE IMPORTED)
11441144
target_include_directories(pybind::pybind11 SYSTEM INTERFACE ${pybind11_INCLUDE_DIRS})
11451145
target_link_libraries(pybind::pybind11 INTERFACE python::python)
1146+
if(CMAKE_BUILD_TYPE MATCHES Debug AND WIN32)
1147+
find_package(Python COMPONENTS Interpreter Development)
1148+
target_link_libraries(pybind::pybind11 INTERFACE ${Python_LIBRARY_RELEASE})
1149+
endif()
11461150
if(APPLE)
11471151
target_link_options(pybind::pybind11 INTERFACE -undefined dynamic_lookup)
11481152
endif()

0 commit comments

Comments
 (0)