Merge topic 'apple_clang_cxx_20_support'

9523ca72e2 Features: Activate C++20 support for AppleClang 10.0+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3294
This commit is contained in:
Brad King 2019-05-14 14:51:49 +00:00 committed by Kitware Robot
commit e0ab9e1cb9
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,4 @@
apple-clang-supports-cxx20
--------------------------
* AppleClang compiler have learned how to compile C++20.

View File

@ -30,9 +30,13 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()
__compiler_check_default_language_standard(CXX 4.0 98)