Merge pull request #27860 from asmorkalov:as/python_restored_dbg

Restored PYTHON_DEBUG_LIBRARIES in python bindings
This commit is contained in:
Alexander Smorkalov 2025-10-03 09:30:08 +03:00 committed by GitHub
commit aa939b3932
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,7 +59,12 @@ endif()
if(APPLE)
set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
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()
if(TARGET gen_opencv_python_source)