You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmake/tools.cmake
+25-60Lines changed: 25 additions & 60 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,6 @@
1
1
# Compiler
2
2
3
-
if (CMAKE_CXX_COMPILER_ID MATCHES"AppleClang")
4
-
set (COMPILER_CLANG 1) # Safe to treat AppleClang as a regular Clang, in general.
5
-
elseif (CMAKE_CXX_COMPILER_ID MATCHES"Clang")
6
-
set (COMPILER_CLANG 1)
7
-
else ()
3
+
if (NOT CMAKE_CXX_COMPILER_ID MATCHES"Clang")
8
4
message (FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} is not supported")
9
5
endif ()
10
6
@@ -17,50 +13,42 @@ set (CLANG_MINIMUM_VERSION 16)
17
13
set (XCODE_MINIMUM_VERSION 12.0)
18
14
set (APPLE_CLANG_MINIMUM_VERSION 12.0.0)
19
15
20
-
if (COMPILER_CLANG)
21
-
if (CMAKE_CXX_COMPILER_ID MATCHES"AppleClang")
22
-
# (Experimental!) Specify "-DALLOW_APPLECLANG=ON" when running CMake configuration step, if you want to experiment with using it.
23
-
if (NOT ALLOW_APPLECLANG ANDNOTDEFINED ENV{ALLOW_APPLECLANG})
24
-
message (FATAL_ERROR "Compilation with AppleClang is unsupported. Please use vanilla Clang, e.g. from Homebrew.")
25
-
endif ()
16
+
if (CMAKE_CXX_COMPILER_ID MATCHES"AppleClang")
17
+
# (Experimental!) Specify "-DALLOW_APPLECLANG=ON" when running CMake configuration step, if you want to experiment with using it.
18
+
if (NOT ALLOW_APPLECLANG ANDNOTDEFINED ENV{ALLOW_APPLECLANG})
19
+
message (FATAL_ERROR "Compilation with AppleClang is unsupported. Please use vanilla Clang, e.g. from Homebrew.")
20
+
endif ()
26
21
27
-
# For a mapping between XCode / AppleClang / vanilla Clang versions, see https://en.wikipedia.org/wiki/Xcode
28
-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS${APPLE_CLANG_MINIMUM_VERSION})
29
-
message (FATAL_ERROR "Compilation with AppleClang version ${CMAKE_CXX_COMPILER_VERSION} is unsupported, the minimum required version is ${APPLE_CLANG_MINIMUM_VERSION} (Xcode ${XCODE_MINIMUM_VERSION}).")
30
-
endif ()
31
-
else ()
32
-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS${CLANG_MINIMUM_VERSION})
33
-
message (FATAL_ERROR "Compilation with Clang version ${CMAKE_CXX_COMPILER_VERSION} is unsupported, the minimum required version is ${CLANG_MINIMUM_VERSION}.")
34
-
endif ()
22
+
# For a mapping between XCode / AppleClang / vanilla Clang versions, see https://en.wikipedia.org/wiki/Xcode
23
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS${APPLE_CLANG_MINIMUM_VERSION})
24
+
message (FATAL_ERROR "Compilation with AppleClang version ${CMAKE_CXX_COMPILER_VERSION} is unsupported, the minimum required version is ${APPLE_CLANG_MINIMUM_VERSION} (Xcode ${XCODE_MINIMUM_VERSION}).")
25
+
endif ()
26
+
else ()
27
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS${CLANG_MINIMUM_VERSION})
28
+
message (FATAL_ERROR "Compilation with Clang version ${CMAKE_CXX_COMPILER_VERSION} is unsupported, the minimum required version is ${CLANG_MINIMUM_VERSION}.")
0 commit comments