diff options
author | Brad King <brad.king@kitware.com> | 2017-04-28 13:52:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-28 13:52:41 (GMT) |
commit | b61e9f8382de26ffe8cc137dfd6d63556d0bf66f (patch) | |
tree | 9f15619b3388a652014f9bd4adac8d825be72f4f /Modules | |
parent | 12512bdb518ca1278a59997c959272625d7f6b6b (diff) | |
parent | 4c2ae38b0b25e7908c25ae939ba235dcaf336c39 (diff) | |
download | CMake-b61e9f8382de26ffe8cc137dfd6d63556d0bf66f.zip CMake-b61e9f8382de26ffe8cc137dfd6d63556d0bf66f.tar.gz CMake-b61e9f8382de26ffe8cc137dfd6d63556d0bf66f.tar.bz2 |
Merge topic 'FindBoost-compile-features'
4c2ae38b Boost Fiber actually require at least C++11.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !749
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindBoost.cmake | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 093d8c9..b2fb4b7 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -889,6 +889,33 @@ function(_Boost_MISSING_DEPENDENCIES componentvar extravar) endfunction() # +# Some boost libraries may require particular set of compler features. +# The very first one was `boost::fiber` introduced in Boost 1.62. +# One can check required compiler features of it in +# `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`. +# +function(_Boost_COMPILER_FEATURES component _ret) + # Boost >= 1.62 and < 1.65 + if(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106500) + set(_Boost_FIBER_COMPILER_FEATURES + cxx_alias_templates + cxx_auto_type + cxx_constexpr + cxx_defaulted_functions + cxx_final + cxx_lambdas + cxx_noexcept + cxx_nullptr + cxx_rvalue_references + cxx_thread_local + cxx_variadic_templates + ) + endif() + string(TOUPPER ${component} uppercomponent) + set(${_ret} ${_Boost_${uppercomponent}_COMPILER_FEATURES} PARENT_SCOPE) +endfunction() + +# # Update library search directory hint variable with paths used by prebuilt boost binaries. # # Prebuilt windows binaries (https://sourceforge.net/projects/boost/files/boost-binaries/) @@ -1640,6 +1667,9 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + # Check if component requires some compiler features + _Boost_COMPILER_FEATURES(${COMPONENT} _Boost_${UPPERCOMPONENT}_COMPILER_FEATURES) + endforeach() # Restore the original find library ordering @@ -1811,6 +1841,10 @@ if(Boost_FOUND) set_target_properties(Boost::${COMPONENT} PROPERTIES INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}") endif() + if(_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES) + set_target_properties(Boost::${COMPONENT} PROPERTIES + INTERFACE_COMPILE_FEATURES "${_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES}") + endif() endif() endif() endforeach() |