diff --git a/CMake/External_Boost.cmake b/CMake/External_Boost.cmake index fb7f7018..0ef43335 100644 --- a/CMake/External_Boost.cmake +++ b/CMake/External_Boost.cmake @@ -50,6 +50,7 @@ ExternalProject_Add(Boost PATCH_COMMAND ${Boost_PATCH_COMMAND} CONFIGURE_COMMAND ${CMAKE_COMMAND} + -DCMAKE_BUILD_TYPE=$ -DCMAKE_VARS_FILE=${fletch_BUILD_PREFIX}/tmp/Boost/CMakeVars.cmake -DBoost_EXTRA_LIBS=${fletch_EXTRA_BOOST_LIBS} ${_Boost_DIR_ARGS} diff --git a/Patches/Boost/Configure.cmake b/Patches/Boost/Configure.cmake index 82e1a5e5..9b90610e 100644 --- a/Patches/Boost/Configure.cmake +++ b/Patches/Boost/Configure.cmake @@ -39,13 +39,19 @@ execute_command_wrapper( ${BOOTSTRAP} ${BOOTSTRAP_ARGS} ) +string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) +if(NOT CMAKE_BUILD_TYPE STREQUAL "debug") # adjust for relwithdebinfo + set(CMAKE_BUILD_TYPE "release") +endif() +message("Boost.Configure.BCP.Build: Using variant=${CMAKE_BUILD_TYPE}") + # Note: BCP has known issues with some msvc release builds so we always build # it in debug. execute_command_wrapper( "Boost.Configure.BCP.Build" ${Boost_SOURCE_DIR}/tools/bcp ${Boost_SOURCE_DIR}/b2${CMAKE_EXECUTABLE_SUFFIX} - variant=debug ${B2_ARGS} + variant=${CMAKE_BUILD_TYPE} ${B2_ARGS} ) execute_command_wrapper(