summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-16 12:54:48 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-06-16 12:54:48 (GMT)
commite2789429aaa18dd7aef4858fb2702bf66d50aa6e (patch)
tree90c741f584bf1f4316f667666450638366da909d /Modules
parent0b028c6f0a44d3b0956170b39fbe921eb8d13f42 (diff)
parentf0a0f3dcb42ee249d7ba0c09e674900adfb9ea2e (diff)
downloadCMake-e2789429aaa18dd7aef4858fb2702bf66d50aa6e.zip
CMake-e2789429aaa18dd7aef4858fb2702bf66d50aa6e.tar.gz
CMake-e2789429aaa18dd7aef4858fb2702bf66d50aa6e.tar.bz2
Merge topic 'features-cleanups'
f0a0f3dc WCDH: Fix compiler id test for compatibility macros. 627ad96b Project: Detect other compilers before detecting Clang. bc950169 WCDH: Remove noise from generated defines. eecd93fc Features: Escape the COMPILE_OPTIONS for dialects.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake4
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake22
2 files changed, 13 insertions, 13 deletions
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index 7f82a9d..e247885 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -61,8 +61,6 @@ function(compiler_id_detection outvar lang)
list(APPEND ordered_compilers
Intel
PathScale
- AppleClang
- Clang
Embarcadero
Borland
Watcom
@@ -84,6 +82,8 @@ function(compiler_id_detection outvar lang)
endif()
list(APPEND ordered_compilers
SCO
+ AppleClang
+ Clang
GNU
MSVC
ADSP
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index d7992fe..593176c 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -99,14 +99,14 @@
#
# .. code-block:: c++
#
-# class MyClass ClimbingStats_DECL_CXX_FINAL
+# class MyClass ClimbingStats_FINAL
# {
-# ClimbingStats_DECL_CXX_CONSTEXPR int someInterface() { return 42; }
+# ClimbingStats_CONSTEXPR int someInterface() { return 42; }
# };
#
-# The ``ClimbingStats_DECL_CXX_FINAL`` macro will expand to ``final`` if the
+# The ``ClimbingStats_FINAL`` macro will expand to ``final`` if the
# compiler (and its flags) support the ``cxx_final`` feature, and the
-# ``ClimbingStats_DECL_CXX_CONSTEXPR`` macro will expand to ``constexpr``
+# ``ClimbingStats_CONSTEXPR`` macro will expand to ``constexpr``
# if ``cxx_constexpr`` is supported.
#
# The following features generate corresponding symbol defines:
@@ -386,7 +386,7 @@ function(write_compiler_detection_header
\n")
endif()
if (feature STREQUAL cxx_constexpr)
- set(def_value "${prefix_arg}_DECL_${feature_upper}")
+ set(def_value "${prefix_arg}_CONSTEXPR")
set(file_content "${file_content}
# if ${def_name}
# define ${def_value} constexpr
@@ -396,7 +396,7 @@ function(write_compiler_detection_header
\n")
endif()
if (feature STREQUAL cxx_final)
- set(def_value "${prefix_arg}_DECL_${feature_upper}")
+ set(def_value "${prefix_arg}_FINAL")
set(file_content "${file_content}
# if ${def_name}
# define ${def_value} final
@@ -406,7 +406,7 @@ function(write_compiler_detection_header
\n")
endif()
if (feature STREQUAL cxx_override)
- set(def_value "${prefix_arg}_DECL_${feature_upper}")
+ set(def_value "${prefix_arg}_OVERRIDE")
set(file_content "${file_content}
# if ${def_name}
# define ${def_value} override
@@ -428,7 +428,7 @@ function(write_compiler_detection_header
set(file_content "${file_content}
# if ${def_name}
# define ${def_value} alignas(X)
-# elif ${prefix_arg}_COMPILER_IS_GNU
+# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang
# define ${def_value} __attribute__ ((__aligned__(X)))
# else
# define ${def_value}
@@ -440,7 +440,7 @@ function(write_compiler_detection_header
set(file_content "${file_content}
# if ${def_name}
# define ${def_value} alignof(X)
-# elif ${prefix_arg}_COMPILER_IS_GNU
+# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang
# define ${def_value} __alignof__(X)
# endif
\n")
@@ -495,10 +495,10 @@ function(write_compiler_detection_header
# if ${def_name}
# define ${def_value} [[deprecated]]
# define ${def_value}_MSG(MSG) [[deprecated(MSG)]]
-# elif defined(__GNUC__) || defined(__clang__)
+# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang
# define ${def_value} __attribute__((__deprecated__))
# define ${def_value}_MSG(MSG) __attribute__((__deprecated__(MSG)))
-# elif defined(_MSC_VER)
+# elif ${prefix_arg}_COMPILER_IS_MSVC
# define ${def_value} __declspec(deprecated)
# define ${def_value}_MSG(MSG) __declspec(deprecated(MSG))
# else