2014-04-02 15:34:16 +02:00
|
|
|
|
|
|
|
# Reference: http://gcc.gnu.org/projects/cxx0x.html
|
2015-01-01 22:00:49 +01:00
|
|
|
# http://gcc.gnu.org/projects/cxx1y.html
|
2014-04-02 15:34:16 +02:00
|
|
|
|
2014-05-08 17:56:29 +02:00
|
|
|
set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407")
|
2014-05-06 00:21:14 +02:00
|
|
|
|
2015-01-01 22:00:49 +01:00
|
|
|
set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L")
|
|
|
|
set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}")
|
|
|
|
|
|
|
|
# GNU 4.9 in c++14 mode sets __cplusplus to 201300L, so don't test for the
|
|
|
|
# correct value of it below.
|
|
|
|
# https://patchwork.ozlabs.org/patch/382470/
|
2014-05-06 00:21:14 +02:00
|
|
|
set(GNU49_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L")
|
|
|
|
set(_cmake_feature_test_cxx_contextual_conversions "${GNU49_CXX14}")
|
|
|
|
set(_cmake_feature_test_cxx_attribute_deprecated "${GNU49_CXX14}")
|
|
|
|
set(_cmake_feature_test_cxx_decltype_auto "${GNU49_CXX14}")
|
|
|
|
set(_cmake_feature_test_cxx_digit_separators "${GNU49_CXX14}")
|
|
|
|
set(_cmake_feature_test_cxx_generic_lambdas "${GNU49_CXX14}")
|
|
|
|
set(_cmake_feature_test_cxx_lambda_init_captures "${GNU49_CXX14}")
|
|
|
|
# GNU 4.3 supports binary literals as an extension, but may warn about
|
|
|
|
# use of extensions prior to GNU 4.9
|
|
|
|
# http://stackoverflow.com/questions/16334024/difference-between-gcc-binary-literals-and-c14-ones
|
|
|
|
set(_cmake_feature_test_cxx_binary_literals "${GNU49_CXX14}")
|
|
|
|
# The feature below is documented as available in GNU 4.8 (by implementing an
|
|
|
|
# earlier draft of the standard paper), but that version of the compiler
|
|
|
|
# does not set __cplusplus to a value greater than 201103L until GNU 4.9:
|
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc-4.8.2/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
|
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc-4.9.0/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
|
|
|
|
# So, CMake only reports availability for it with GNU 4.9 or later.
|
|
|
|
set(_cmake_feature_test_cxx_return_type_deduction "${GNU49_CXX14}")
|
|
|
|
|
2014-04-04 09:25:46 +02:00
|
|
|
# Introduced in GCC 4.8.1
|
2014-05-10 08:58:49 +02:00
|
|
|
set(GNU481_CXX11 "((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L")
|
2014-04-06 10:17:15 +02:00
|
|
|
set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${GNU481_CXX11}")
|
|
|
|
set(_cmake_feature_test_cxx_reference_qualified_functions "${GNU481_CXX11}")
|
2014-04-03 19:18:01 +02:00
|
|
|
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
|
2014-04-04 13:54:08 +02:00
|
|
|
set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
|
2013-10-21 16:59:40 +02:00
|
|
|
# The alignof feature works with GNU 4.7 and -std=c++11, but it is documented
|
|
|
|
# as available with GNU 4.8, so treat that as true.
|
2014-04-04 13:55:27 +02:00
|
|
|
set(_cmake_feature_test_cxx_alignof "${GNU48_CXX11}")
|
2014-04-04 14:10:17 +02:00
|
|
|
set(_cmake_feature_test_cxx_attributes "${GNU48_CXX11}")
|
2014-04-03 19:18:01 +02:00
|
|
|
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
|
2014-04-06 10:10:54 +02:00
|
|
|
set(_cmake_feature_test_cxx_thread_local "${GNU48_CXX11}")
|
2014-04-06 13:00:17 +02:00
|
|
|
set(GNU47_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L")
|
2014-04-04 10:50:41 +02:00
|
|
|
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
|
2014-04-07 17:28:55 +02:00
|
|
|
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
|
2014-04-06 10:37:52 +02:00
|
|
|
set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}")
|
2014-03-18 23:42:05 +01:00
|
|
|
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
|
2014-04-03 19:32:06 +02:00
|
|
|
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
|
2014-04-03 19:29:17 +02:00
|
|
|
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
|
2014-03-19 13:32:59 +01:00
|
|
|
set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
|
2014-04-04 10:56:09 +02:00
|
|
|
set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
|
2014-04-02 15:02:41 +02:00
|
|
|
# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
|
|
|
|
# release following that (March 2012), and the first minor release to
|
|
|
|
# support -std=c++11. Prior to that, support for C++11 features is technically
|
|
|
|
# experiemental and possibly incomplete (see for example the note below about
|
|
|
|
# cxx_variadic_template_template_parameters)
|
2014-03-18 12:53:01 +01:00
|
|
|
# TODO: Should be supported by GNU 4.6
|
2014-05-08 17:56:29 +02:00
|
|
|
set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
2014-03-18 12:53:01 +01:00
|
|
|
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
|
2014-04-06 11:22:49 +02:00
|
|
|
set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}")
|
2014-04-06 10:37:08 +02:00
|
|
|
set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}")
|
2014-04-03 19:34:47 +02:00
|
|
|
set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}")
|
2014-04-03 19:40:06 +02:00
|
|
|
set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}")
|
2014-04-04 11:06:02 +02:00
|
|
|
set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}")
|
2014-04-03 19:12:26 +02:00
|
|
|
# TODO: Should be supported by GNU 4.5
|
2014-05-08 17:56:29 +02:00
|
|
|
set(GNU45_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
2014-04-03 19:12:26 +02:00
|
|
|
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
|
2014-04-03 19:23:40 +02:00
|
|
|
set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}")
|
2014-04-06 10:38:50 +02:00
|
|
|
set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}")
|
2014-04-04 09:15:18 +02:00
|
|
|
set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}")
|
2014-04-02 15:34:16 +02:00
|
|
|
# TODO: Should be supported by GNU 4.4
|
2014-05-08 17:56:29 +02:00
|
|
|
set(GNU44_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
2014-04-02 15:34:16 +02:00
|
|
|
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
|
2014-04-03 00:12:02 +02:00
|
|
|
set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
|
2014-04-03 00:15:53 +02:00
|
|
|
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
|
2014-04-04 14:52:48 +02:00
|
|
|
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
|
2014-04-06 10:07:19 +02:00
|
|
|
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
|
2014-04-06 10:09:37 +02:00
|
|
|
set(_cmake_feature_test_cxx_sizeof_member "${GNU44_CXX11}")
|
2014-04-03 00:02:54 +02:00
|
|
|
set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
|
2014-04-04 00:02:14 +02:00
|
|
|
set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
|
2014-04-04 10:59:22 +02:00
|
|
|
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
|
2014-04-04 14:53:25 +02:00
|
|
|
set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}")
|
2014-04-02 15:02:41 +02:00
|
|
|
set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
|
|
|
|
# TODO: If features are ever recorded for GNU 4.3, there should possibly
|
|
|
|
# be a new feature added like cxx_variadic_template_template_parameters,
|
|
|
|
# which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
|
|
|
|
# actually implemented by GNU 4.3, but variadic template template parameters
|
|
|
|
# 'completes' it, so that is the version we record as having the variadic
|
|
|
|
# templates capability in CMake. See
|
|
|
|
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
|
2014-04-04 00:00:28 +02:00
|
|
|
# TODO: Should be supported by GNU 4.3
|
2014-05-08 17:56:29 +02:00
|
|
|
set(GNU43_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
2014-04-03 00:08:49 +02:00
|
|
|
set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}")
|
2014-04-06 10:41:01 +02:00
|
|
|
set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}")
|
2014-04-06 11:14:42 +02:00
|
|
|
set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}")
|
2014-04-06 10:17:20 +02:00
|
|
|
set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}")
|
2014-04-04 09:39:40 +02:00
|
|
|
set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}")
|
2014-04-04 00:00:28 +02:00
|
|
|
set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
|
2014-04-04 13:11:37 +02:00
|
|
|
# TODO: Should be supported since GNU 3.4?
|
2014-05-08 17:56:29 +02:00
|
|
|
set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
2014-04-04 15:05:10 +02:00
|
|
|
# TODO: Should be supported forever?
|
2014-05-08 17:56:29 +02:00
|
|
|
set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
|
|
|
set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L")
|
|
|
|
set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus >= 199711L")
|