From ab65862417adc80dfb18170a6bd70889a24fe045 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2013 13:52:48 -0400 Subject: Clang: Add separate "AppleClang" compiler id Apple distributes their own Clang build with their own version numbers that differ from upstream Clang. Use the __apple_build_version__ symbol to identify the Apple Clang compiler and report the Apple Build Version as the fourth version component in CMAKE__COMPILER_VERSION. Add Compiler/AppleClang- and Platform/Darwin-AppleClang- modules that simply include the upstream equivalents. Fix comparisons of CMAKE__COMPILER_ID to Clang in CMake's own source and tests to account for AppleClang. --- Modules/CMakeCCompilerId.c.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Modules/CMakeCCompilerId.c.in') diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 66a5582650..56c11a0bbd 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -29,7 +29,12 @@ # endif #elif defined(__clang__) -# define COMPILER_ID "Clang" +# if defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) +# else +# define COMPILER_ID "Clang" +# endif # define COMPILER_VERSION_MAJOR DEC(__clang_major__) # define COMPILER_VERSION_MINOR DEC(__clang_minor__) # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -- cgit v1.2.1