summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-03 13:36:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-03 13:36:37 (GMT)
commitcad7385ab6e76b344406214aa103bee505939156 (patch)
tree7a03309bad73138c39d5e478cbac95359f3c71a6 /Modules
parent5ab647cdde2aeecf359fc47f40dc9548efc43900 (diff)
parent12e6796b6289dbc910b9b7fe57f6b564edbc46dd (diff)
downloadCMake-cad7385ab6e76b344406214aa103bee505939156.zip
CMake-cad7385ab6e76b344406214aa103bee505939156.tar.gz
CMake-cad7385ab6e76b344406214aa103bee505939156.tar.bz2
Merge topic 'android-clang-std-flags'
12e6796b62 Android: Do not pass non-existent Clang -std flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1913
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 321ddf6..77866e9 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -32,7 +32,12 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ set(_clang_version_std17 5.0)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(_clang_version_std17 6.0)
+ endif()
+
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
@@ -40,10 +45,12 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()
+
+ unset(_clang_version_std17)
else()
# clang-cl does not know these options because it behaves like cl.exe
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")