diff options
author | Brad King <brad.king@kitware.com> | 2010-05-17 18:11:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-05-17 18:11:20 (GMT) |
commit | 571dc7489111893355deba710feee5990bce92e4 (patch) | |
tree | 11d48c783134fd52b2e80bf00b3a6983fbe1c1f4 | |
parent | e6cd880381ec536be277da3b590b5f326b848e1f (diff) | |
download | CMake-571dc7489111893355deba710feee5990bce92e4.zip CMake-571dc7489111893355deba710feee5990bce92e4.tar.gz CMake-571dc7489111893355deba710feee5990bce92e4.tar.bz2 |
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".
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 3 | ||||
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 3 | ||||
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Linux-Clang-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Linux-Clang-CXX.cmake | 1 |
6 files changed, 10 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 5d004c7..accda32 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/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" diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 00ab8e2..4a32823 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/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" diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake new file mode 100644 index 0000000..f7baf68 --- /dev/null +++ b/Modules/Compiler/Clang-C.cmake @@ -0,0 +1 @@ +include(Compiler/GNU-C) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake new file mode 100644 index 0000000..d3c403a --- /dev/null +++ b/Modules/Compiler/Clang-CXX.cmake @@ -0,0 +1 @@ +include(Compiler/GNU-CXX) diff --git a/Modules/Platform/Linux-Clang-C.cmake b/Modules/Platform/Linux-Clang-C.cmake new file mode 100644 index 0000000..dbf8956 --- /dev/null +++ b/Modules/Platform/Linux-Clang-C.cmake @@ -0,0 +1 @@ +INCLUDE(Platform/Linux-GNU-C) diff --git a/Modules/Platform/Linux-Clang-CXX.cmake b/Modules/Platform/Linux-Clang-CXX.cmake new file mode 100644 index 0000000..8fe251c --- /dev/null +++ b/Modules/Platform/Linux-Clang-CXX.cmake @@ -0,0 +1 @@ +INCLUDE(Platform/Linux-GNU-CXX) |