From 683e4e9caba5fda32f9ae14473a0fe612c3f783c Mon Sep 17 00:00:00 2001 From: Ken Matsui <07softy_bride@icloud.com> Date: Fri, 11 Mar 2022 07:51:25 -0500 Subject: AppleClang: Add C++20 and C++23 flags Follow up commit 886e27062b (Clang/MSVC: C++20 final flag, C++23 support, 2021-05-29, v3.20.4~7^2) with support for AppleClang. --- Modules/Compiler/AppleClang-CXX.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 28be1df..7c97969 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -47,9 +47,17 @@ 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) +if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") +elseif (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() +if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) + set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b") + set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b") +endif() + __compiler_check_default_language_standard(CXX 4.0 98) -- cgit v0.12