diff options
author | Brad King <brad.king@kitware.com> | 2023-09-28 13:50:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-09-28 13:50:36 (GMT) |
commit | 88c7eaa7a7d38bbc07d2a8947a78403250d229a9 (patch) | |
tree | 9727e2c3f7fcd64bea2cad2d71293a3ee594d102 /Modules/Compiler | |
parent | bf76104cd3dcebb2b6141954612c3bc7c831fcd2 (diff) | |
parent | 75e9918a669666b16e7819b384c50858ea9d868b (diff) | |
download | CMake-88c7eaa7a7d38bbc07d2a8947a78403250d229a9.zip CMake-88c7eaa7a7d38bbc07d2a8947a78403250d229a9.tar.gz CMake-88c7eaa7a7d38bbc07d2a8947a78403250d229a9.tar.bz2 |
Merge topic 'android-clang-c++23'
75e9918a66 Android: Require Clang 18 for -std=c++23
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !8847
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 46f5fc1..e5683c2 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -173,7 +173,12 @@ macro(__compiler_clang_cxx_standards lang) unset(_clang_version_std17) - if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 17.0) + set(_clang_version_std23 17.0) + if(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(_clang_version_std23 18.0) + endif() + + if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std23}") set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23") set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++23") set(CMAKE_${lang}26_STANDARD_COMPILE_OPTION "-std=c++26") @@ -183,6 +188,8 @@ macro(__compiler_clang_cxx_standards lang) set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++2b") endif() + unset(_clang_version_std23) + if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") # The MSVC standard library requires C++14, and MSVC itself has no # notion of operating in a mode not aware of at least that standard. |