From 9175723e0328570f12975333d4f9cc0d863a6643 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 8 Jan 2020 19:18:58 +0300 Subject: common.cmake: CC_STATIC_RUNTIME=OFF implied if using dynamic Boost libs --- .travis.yml | 3 ++- appveyor.yml | 1 - cmake/common.cmake | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56abeba..8531063 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,7 @@ jobs: ./boost/build/build.py build --configuration Debug --platform x86 + --link static -- ./boost_1_58_0 --with-filesystem --with-program_options - bash -o pipefail -c 'find boost_1_58_0/stage -type f | sort' @@ -56,9 +57,9 @@ jobs: --install "$HOME/install/boost_1_58_0" --configuration Debug -- cmake/examples/boost + -D "CMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/toolchains/gcc-x86.cmake" -D "BOOST_ROOT=$TRAVIS_BUILD_DIR/boost_1_58_0" -D "BOOST_LIBRARYDIR=$TRAVIS_BUILD_DIR/boost_1_58_0/stage/x86/Debug/lib" - -D "CMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/toolchains/gcc-x86.cmake" - "$HOME/install/boost_1_58_0/bin/foo" - ./.ci/verify_arch.sh "$HOME/install/boost_1_58_0/bin/foo" x86 diff --git a/appveyor.yml b/appveyor.yml index ce3aeeb..7dbda80 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -86,7 +86,6 @@ build_script: --configuration Release -- cmake/examples/boost -A x64 - -D CC_STATIC_RUNTIME=OFF -D "BOOST_ROOT=%APPVEYOR_BUILD_FOLDER%\boost_1_72_0" -D "BOOST_LIBRARYDIR=%APPVEYOR_BUILD_FOLDER%\boost_1_72_0\stage\x64\lib" -D Boost_USE_STATIC_LIBS=OFF diff --git a/cmake/common.cmake b/cmake/common.cmake index 447f340..1e23121 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -60,7 +60,12 @@ if(NOT DEFINED CC_WINDOWS_DEF) endif() if(NOT DEFINED CC_STATIC_RUNTIME) set(static_runtime_default_value "${default_value}") + if(DEFINED Boost_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS) + # Linking to dynamic Boost libs and the static runtime is a no-no: + set(static_runtime_default_value OFF) + endif() if(UNIX) + # Linking to the GNU C library statically is dangerous: set(static_runtime_default_value OFF) endif() option(CC_STATIC_RUNTIME "Link the runtime statically" "${static_runtime_default_value}") -- cgit v1.2.3