Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@bradking bradking authored
View
3  Modules/CMakeCCompilerId.c.in
@@ -9,6 +9,9 @@
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
View
3  Modules/CMakeCXXCompilerId.cpp.in
@@ -11,6 +11,9 @@
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
View
1  Modules/Compiler/Clang-C.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-C)
View
1  Modules/Compiler/Clang-CXX.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-CXX)
@rpavlik
rpavlik added a note

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
1  Modules/Platform/Linux-Clang-C.cmake
@@ -0,0 +1 @@
+INCLUDE(Platform/Linux-GNU-C)
View
1  Modules/Platform/Linux-Clang-CXX.cmake
@@ -0,0 +1 @@
+INCLUDE(Platform/Linux-GNU-CXX)
@rpavlik

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.