GNU-CXX-FeatureTests.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. # Reference: http://gcc.gnu.org/projects/cxx0x.html
  2. set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
  3. # TODO: Should be supported by GNU 4.7
  4. set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
  5. set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
  6. set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
  7. # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
  8. # release following that (March 2012), and the first minor release to
  9. # support -std=c++11. Prior to that, support for C++11 features is technically
  10. # experiemental and possibly incomplete (see for example the note below about
  11. # cxx_variadic_template_template_parameters)
  12. # TODO: Should be supported by GNU 4.6
  13. set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
  14. set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
  15. # TODO: Should be supported by GNU 4.4
  16. set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
  17. set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
  18. set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}")
  19. # TODO: If features are ever recorded for GNU 4.3, there should possibly
  20. # be a new feature added like cxx_variadic_template_template_parameters,
  21. # which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is
  22. # actually implemented by GNU 4.3, but variadic template template parameters
  23. # 'completes' it, so that is the version we record as having the variadic
  24. # templates capability in CMake. See
  25. # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
  26. # TODO: Should be supported by GNU 4.3
  27. set(GNU43_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
  28. set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}")
  29. set(_oldestSupported)