Clang-CXX-TestableFeatures.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. set(testable_features
  2. cxx_alias_templates
  3. cxx_alignas
  4. cxx_attributes
  5. cxx_auto_type
  6. cxx_binary_literals
  7. cxx_constexpr
  8. cxx_contextual_conversions
  9. cxx_decltype
  10. cxx_default_function_template_args
  11. cxx_defaulted_functions
  12. cxx_delegating_constructors
  13. cxx_deleted_functions
  14. cxx_explicit_conversions
  15. cxx_generalized_initializers
  16. cxx_inheriting_constructors
  17. cxx_lambdas
  18. cxx_local_type_template_args
  19. cxx_noexcept
  20. cxx_nonstatic_member_init
  21. cxx_nullptr
  22. cxx_range_for
  23. cxx_raw_string_literals
  24. cxx_reference_qualified_functions
  25. cxx_relaxed_constexpr
  26. cxx_return_type_deduction
  27. cxx_rvalue_references
  28. cxx_static_assert
  29. cxx_strong_enums
  30. cxx_thread_local
  31. cxx_unicode_literals
  32. cxx_unrestricted_unions
  33. cxx_user_literals
  34. cxx_variable_templates
  35. cxx_variadic_templates
  36. )
  37. if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
  38. list(APPEND testable_features cxx_decltype_incomplete_return_types)
  39. endif()
  40. foreach(feature ${testable_features})
  41. set(_cmake_feature_test_${feature} "${_cmake_oldestSupported} && __has_feature(${feature})")
  42. endforeach()
  43. unset(testable_features)
  44. set(_cmake_feature_test_cxx_aggregate_default_initializers "${_cmake_oldestSupported} && __has_feature(cxx_aggregate_nsdmi)")
  45. set(_cmake_feature_test_cxx_trailing_return_types "${_cmake_oldestSupported} && __has_feature(cxx_trailing_return)")
  46. set(_cmake_feature_test_cxx_alignof "${_cmake_oldestSupported} && __has_feature(cxx_alignas)")
  47. set(_cmake_feature_test_cxx_final "${_cmake_oldestSupported} && __has_feature(cxx_override_control)")
  48. set(_cmake_feature_test_cxx_override "${_cmake_oldestSupported} && __has_feature(cxx_override_control)")
  49. set(_cmake_feature_test_cxx_uniform_initialization "${_cmake_oldestSupported} && __has_feature(cxx_generalized_initializers)")
  50. set(_cmake_feature_test_cxx_defaulted_move_initializers "${_cmake_oldestSupported} && __has_feature(cxx_defaulted_functions)")
  51. set(_cmake_feature_test_cxx_lambda_init_captures "${_cmake_oldestSupported} && __has_feature(cxx_init_captures)")