Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Recognize Clang C and C++ compilers (see #10693)

Map to the platform and compiler information for GNU because the
compilers are command-line compatible for common operations.  Later we
can add Clang-specific features as necessary.  We honor the preferred
capitalization is "Clang", not the common mis-spelling "CLang".
  • Loading branch information...
commit 571dc7489111893355deba710feee5990bce92e4 1 parent e6cd880
Brad King authored May 17, 2010
3  Modules/CMakeCCompilerId.c.in
@@ -9,6 +9,9 @@
9 9
 #if defined(__INTEL_COMPILER) || defined(__ICC)
10 10
 # define COMPILER_ID "Intel"
11 11
 
  12
+#elif defined(__clang__)
  13
+# define COMPILER_ID "Clang"
  14
+
12 15
 #elif defined(__BORLANDC__)
13 16
 # define COMPILER_ID "Borland"
14 17
 
3  Modules/CMakeCXXCompilerId.cpp.in
@@ -11,6 +11,9 @@
11 11
 #elif defined(__INTEL_COMPILER) || defined(__ICC)
12 12
 # define COMPILER_ID "Intel"
13 13
 
  14
+#elif defined(__clang__)
  15
+# define COMPILER_ID "Clang"
  16
+
14 17
 #elif defined(__BORLANDC__)
15 18
 # define COMPILER_ID "Borland"
16 19
 
1  Modules/Compiler/Clang-C.cmake
... ...
@@ -0,0 +1 @@
  1
+include(Compiler/GNU-C)
1  Modules/Compiler/Clang-CXX.cmake
... ...
@@ -0,0 +1 @@
  1
+include(Compiler/GNU-CXX)
1  Modules/Platform/Linux-Clang-C.cmake
... ...
@@ -0,0 +1 @@
  1
+INCLUDE(Platform/Linux-GNU-C)
1  Modules/Platform/Linux-Clang-CXX.cmake
... ...
@@ -0,0 +1 @@
  1
+INCLUDE(Platform/Linux-GNU-CXX)

0 notes on commit 571dc74

Ryan Pavlik

Could a variable be set here such as CMAKE_COMPILER_IS_CLANGCXX to permit clang-specific project-level configuration? (Same for the above change, as well)

Please sign in to comment.
Something went wrong with that request. Please try again.