Skip to content

Commit

Permalink
HYDRA-700 : Keep BOOST_PYTHON_DEBUG in MSVC builds (+explanation)
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Jan 18, 2024
1 parent 2d6753f commit 0a38ffb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/compiler_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<STREQUAL:${CMAKE_BUILD_TYPE},Debug>:BOOST_DEBUG_PYTHON>
)
endif()

Expand Down

0 comments on commit 0a38ffb

Please sign in to comment.