From 41def393e21f9e9fb7c4cebc92f48948a1bdf421 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Aug 2015 15:18:39 -0500 Subject: [PATCH] CMake: Prevent bundled boost from (dl)opening itself on Windows --- cmake/configure/configure_boost.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/configure/configure_boost.cmake b/cmake/configure/configure_boost.cmake index 0460eaa7ab..d91c87a91b 100644 --- a/cmake/configure/configure_boost.cmake +++ b/cmake/configure/configure_boost.cmake @@ -35,6 +35,16 @@ MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs") SET(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include) + + IF(CMAKE_SYSTEM_NAME MATCHES "Windows") + # + # Bundled boost tries to (dl)open itself as a dynamic library on + # Windows. Disable this undesired behavior by exporting + # BOOST_ALL_NO_LIB on Windows platforms (for bundled boost). + # + LIST(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB") + LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_ALL_NO_LIB") + ENDIF() ENDMACRO() -- 2.39.5