diff --git a/cmake/compiler_config.cmake b/cmake/compiler_config.cmake index db021f6df1..a383e7c00b 100644 --- a/cmake/compiler_config.cmake +++ b/cmake/compiler_config.cmake @@ -128,6 +128,13 @@ function(mayaHydra_compile_config TARGET) target_compile_definitions(${TARGET} PRIVATE ${MSVC_DEFINITIONS} + # In debug builds, Boost's wrap_python.hpp will #undef _DEBUG when BOOST_DEBUG_PYTHON is not defined, + # and will then include pyconfig.h : + # https://github.com/boostorg/python/blob/boost-1.81.0/include/boost/python/detail/wrap_python.hpp#L23-L57 + # pyconfig.h will then autolink the Python lib; however, since _DEBUG was #undef'd, it will try to + # link against the release version of the Python lib, causing a linker error : + # https://github.com/python/cpython/blob/v3.11.4/PC/pyconfig.h#L269-L286 + $<$:BOOST_DEBUG_PYTHON> ) endif()