Restored PYTHON_DEBUG_LIBRARIES in python bindings.

This commit is contained in:
Alexander Smorkalov 2025-10-02 09:00:22 +03:00
parent e9bded6ff3
commit d5cdad7629

View File

@ -59,7 +59,12 @@ endif()
if(APPLE) if(APPLE)
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
elseif(WIN32 OR OPENCV_FORCE_PYTHON_LIBS) elseif(WIN32 OR OPENCV_FORCE_PYTHON_LIBS)
ocv_target_link_libraries(${the_module} PRIVATE ${${PYTHON}_LIBRARIES}) if(${PYTHON}_DEBUG_LIBRARIES AND NOT ${PYTHON}_LIBRARIES MATCHES "optimized.*debug")
ocv_target_link_libraries(${the_module} PRIVATE ${${PYTHON}_LIBRARIES})
ocv_target_link_libraries(${the_module} PRIVATE debug ${${PYTHON}_DEBUG_LIBRARIES} optimized ${${PYTHON}_LIBRARIES})
else()
ocv_target_link_libraries(${the_module} PRIVATE ${${PYTHON}_LIBRARIES})
endif()
endif() endif()
if(TARGET gen_opencv_python_source) if(TARGET gen_opencv_python_source)