summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2017-04-23 14:19:37 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2017-04-23 14:19:37 (GMT)
commit4c2ae38b0b25e7908c25ae939ba235dcaf336c39 (patch)
tree0de967a4f379da58519378ca99823bf4207d46f5
parent8494aa7adf3ed2403528af05aed80dea61911b35 (diff)
downloadCMake-4c2ae38b0b25e7908c25ae939ba235dcaf336c39.zip
CMake-4c2ae38b0b25e7908c25ae939ba235dcaf336c39.tar.gz
CMake-4c2ae38b0b25e7908c25ae939ba235dcaf336c39.tar.bz2
Boost Fiber actually require at least C++11.
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`.
-rw-r--r--Modules/FindBoost.cmake34
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()