[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-3092-g3d6860a

Stephen Kelly steveire at gmail.com
Sat May 10 03:45:22 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  3d6860a087e1c13bbde0190b1d9990963b547760 (commit)
       via  aab05bb3bd6a8032f05a4272e07c0a2e2ceb152a (commit)
       via  4726bf3b399f2f232ee590605246f230b99c0623 (commit)
      from  c5d7dbc482187f9c47cc9a7c2efaa352cc34bf5b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d6860a087e1c13bbde0190b1d9990963b547760
commit 3d6860a087e1c13bbde0190b1d9990963b547760
Merge: c5d7dbc aab05bb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 10 03:45:21 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat May 10 03:45:21 2014 -0400

    Merge topic 'WriteCompilerDetectionHeader-module' into next
    
    aab05bb3 Write the header only if it changes.
    4726bf3b Clean up a bit.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aab05bb3bd6a8032f05a4272e07c0a2e2ceb152a
commit aab05bb3bd6a8032f05a4272e07c0a2e2ceb152a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 10 09:30:13 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat May 10 09:33:34 2014 +0200

    Write the header only if it changes.

diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 5f2a92a..e490347 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -198,7 +198,7 @@ function(write_compiler_detection_header
     endif()
   endforeach()
 
-  file(WRITE ${file_arg} "
+  set(file_content "
 // This is a generated file. Do not edit!
 
 #ifndef ${prefix_arg}_COMPILER_DETECTION_H
@@ -206,7 +206,7 @@ function(write_compiler_detection_header
 ")
 
   if (_WCD_PROLOG)
-    file(APPEND "${file_arg}" "\n${_WCD_PROLOG}\n")
+    set(file_content "${file_content}\n${_WCD_PROLOG}\n")
   endif()
 
   foreach(feature ${_WCD_FEATURES})
@@ -230,21 +230,23 @@ function(write_compiler_detection_header
     endforeach()
 
     if(_lang STREQUAL CXX)
-      file(APPEND "${file_arg}" "\n#ifdef __cplusplus\n")
+      set(file_content "${file_content}\n#ifdef __cplusplus\n")
     endif()
 
     compiler_id_detection(ID_CONTENT ${_lang} PREFIX ${prefix_arg}_
       ID_DEFINE
     )
 
-    file(APPEND "${file_arg}" "${ID_CONTENT}\n")
+    set(file_content "${file_content}${ID_CONTENT}\n")
 
     set(pp_if "if")
     foreach(compiler ${_WCD_COMPILERS})
       _load_compiler_variables(${compiler} ${_lang} ${${_lang}_features})
-      file(APPEND "${file_arg}" "\n#  ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n")
-      file(APPEND "${file_arg}"
-          "\n#    if !(${_cmake_oldestSupported_${compiler}})\n#      error Unsupported compiler version\n#    endif\n")
+      set(file_content "${file_content}\n#  ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n")
+      set(file_content "${file_content}
+#    if !(${_cmake_oldestSupported_${compiler}})
+#      error Unsupported compiler version
+#    endif\n")
       set(pp_if "elif")
       foreach(feature ${${_lang}_features})
         string(TOUPPER ${feature} feature_upper)
@@ -256,11 +258,14 @@ function(write_compiler_detection_header
           set(_define_item "\n#      define ${prefix_arg}_${feature_PP} 0\n")
           set(_define_item "\n#    if ${_cmake_feature_test_${compiler}_${feature}}\n#      define ${prefix_arg}_${feature_PP} 1\n#    else${_define_item}#    endif\n")
         endif()
-        file(APPEND "${file_arg}" "${_define_item}")
+        set(file_content "${file_content}${_define_item}")
       endforeach()
     endforeach()
     if(pp_if STREQUAL "elif")
-      file(APPEND "${file_arg}" "\n#  else\n#    error Unsupported compiler\n#  endif\n\n")
+      set(file_content "${file_content}
+#  else
+#    error Unsupported compiler
+#  endif\n")
     endif()
     foreach(feature ${${_lang}_features})
       string(TOUPPER ${feature} feature_upper)
@@ -268,7 +273,7 @@ function(write_compiler_detection_header
       set(def_name ${prefix_arg}_${feature_PP})
       if (feature STREQUAL cxx_constexpr)
         set(def_value "${prefix_arg}_DECL_${feature_upper}")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} constexpr
 #  else
@@ -278,7 +283,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_final)
         set(def_value "${prefix_arg}_DECL_${feature_upper}")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} final
 #  else
@@ -288,7 +293,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_override)
         set(def_value "${prefix_arg}_DECL_${feature_upper}")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} override
 #  else
@@ -302,11 +307,11 @@ function(write_compiler_detection_header
         set(static_assert_struct "template<bool> struct ${prefix_arg}StaticAssert;\ntemplate<> struct ${prefix_arg}StaticAssert<true>{};\n")
         set(def_standard "#    define ${def_value} static_assert(X, #X)\n#    define ${def_value_msg} static_assert(X, MSG)")
         set(def_alternative "${static_assert_struct}#    define ${def_value} sizeof(${prefix_arg}StaticAssert<X>)\n#    define ${def_value_msg} sizeof(${prefix_arg}StaticAssert<X>)")
-        file(APPEND "${file_arg}" "#  if ${def_name}\n${def_standard}\n#  else\n${def_alternative}\n#  endif\n\n")
+        set(file_content "${file_content}#  if ${def_name}\n${def_standard}\n#  else\n${def_alternative}\n#  endif\n\n")
       endif()
       if (feature STREQUAL cxx_alignas)
         set(def_value "${prefix_arg}_ALIGNAS(X)")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} alignas(X)
 #  elif ${prefix_arg}_COMPILER_IS_GNU
@@ -318,7 +323,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_alignof)
         set(def_value "${prefix_arg}_ALIGNOF(X)")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} alignof(X)
 #  elif ${prefix_arg}_COMPILER_IS_GNU
@@ -328,7 +333,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_deleted_functions)
         set(def_value "${prefix_arg}_DELETED_FUNCTION")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} = delete
 #  else
@@ -338,7 +343,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_extern_templates)
         set(def_value "${prefix_arg}_EXTERN_TEMPLATE")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} extern
 #  else
@@ -348,7 +353,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_noexcept)
         set(def_value "${prefix_arg}_NOEXCEPT")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} noexcept
 #    define ${def_value}_EXPR(X) noexcept(X)
@@ -360,7 +365,7 @@ function(write_compiler_detection_header
       endif()
       if (feature STREQUAL cxx_nullptr)
         set(def_value "${prefix_arg}_NULLPTR")
-        file(APPEND "${file_arg}" "
+        set(file_content "${file_content}
 #  if ${def_name}
 #    define ${def_value} nullptr
 #  else
@@ -370,14 +375,19 @@ function(write_compiler_detection_header
       endif()
     endforeach()
     if(_lang STREQUAL CXX)
-      file(APPEND "${file_arg}" "#endif\n")
+      set(file_content "${file_content}#endif\n")
     endif()
 
   endforeach()
 
   if (_WCD_EPILOG)
-    file(APPEND "${file_arg}" "\n${_WCD_EPILOG}\n")
+    set(file_content "${file_content}\n${_WCD_EPILOG}\n")
   endif()
+  set(file_content "${file_content}\n#endif")
 
-  file(APPEND ${file_arg} "\n#endif\n")
+  set(CMAKE_CONFIGURABLE_FILE_CONTENT ${file_content})
+  configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+    "${file_arg}"
+    @ONLY
+  )
 endfunction()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4726bf3b399f2f232ee590605246f230b99c0623
commit 4726bf3b399f2f232ee590605246f230b99c0623
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat May 10 09:09:00 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat May 10 09:29:57 2014 +0200

    Clean up a bit.

diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index f060f0f..5f2a92a 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -35,7 +35,7 @@
 # At least one ``<compiler>`` and one ``<feature>`` must be listed. Compilers
 # which are known to CMake, but not specified are detected and a preprocessor
 # ``#error`` is generated for them.  A preprocessor macro matching
-# ``${PREFIX}_COMPILER_IS_${CompilerId}`` is generated for each compiler
+# ``<PREFIX>_COMPILER_IS_${CompilerId}`` is generated for each compiler
 # known to CMake to contain the value ``0`` or ``1``.
 #
 # Feature Test Macros
@@ -43,7 +43,7 @@
 #
 # For each compiler, a preprocessor test of the compiler version is generated
 # denoting whether the each feature is enabled.  A preprocessor macro
-# matching ``${PREFIX}_COMPILER_${FEATURE_NAME_UPPER}`` is generated to
+# matching ``<PREFIX>_COMPILER_${FEATURE_NAME_UPPER}`` is generated to
 # contain the value ``0`` or ``1`` depending on whether the compiler in
 # use supports the feature:
 #
@@ -75,8 +75,7 @@
 # =============
 #
 # Some additional symbol-defines are created for particular features for
-# use as symbols which may be conditionally defined empty. The macros for
-# such symbol defines match ``${PREFIX}_DECL_${FEATURE_NAME_UPPER}``:
+# use as symbols which may be conditionally defined empty:
 #
 # .. code-block:: c++
 #
@@ -92,41 +91,40 @@
 #
 # The following features generate corresponding symbol defines:
 #
-# ========================== ===============
-#         Feature                 Symbol
-# ========================== ===============
-# ``cxx_constexpr``           ``constexpr``
-# ``cxx_deleted_functions``   ``= delete``
-# ``cxx_extern_templates``    ``extern``
-# ``cxx_final``               ``final``
-# ``cxx_noexcept``            ``noexcept``
-# ``cxx_override``            ``override``
-# ========================== ===============
+# ========================== =================================== =================
+#         Feature                          Define                      Symbol
+# ========================== =================================== =================
+# ``cxx_constexpr``           ``<PREFIX>_CONSTEXPR``              ``constexpr``
+# ``cxx_deleted_functions``   ``<PREFIX>_DELETED_FUNCTION``       ``= delete``
+# ``cxx_extern_templates``    ``<PREFIX>_EXTERN_TEMPLATE``        ``extern``
+# ``cxx_final``               ``<PREFIX>_FINAL``                  ``final``
+# ``cxx_noexcept``            ``<PREFIX>_NOEXCEPT``               ``noexcept``
+# ``cxx_noexcept``            ``<PREFIX>_NOEXCEPT_EXPR(X)``       ``noexcept(X)``
+# ``cxx_override``            ``<PREFIX>_OVERRIDE``               ``override``
+# ========================== =================================== =================
 #
-# Compatibility Implemetation Macros
-# ==================================
+# Compatibility Implementation Macros
+# ===================================
 #
 # Some features are suitable for wrapping in a macro with a backward
 # compatibility implementation if the compiler does not support the feature.
 #
 # When the ``cxx_static_assert`` feature is not provided by the compiler,
 # a compatibility implementation is available via the
-# ``${PREFIX}_STATIC_ASSERT`` and ``${PREFIX}_STATIC_ASSERT_MSG``
+# ``<PREFIX>}_STATIC_ASSERT`` and ``<PREFIX>_STATIC_ASSERT_MSG``
 # function-like macros. The macros expand to ``static_assert`` where that
 # compiler feature is available, and to a compatibility implementation
-# otherwise.
+# or compiler extension otherwise.
 #
-# ========================== ================================
-#         Feature                         Define
-# ========================== ================================
-# ``cxx_alignas``              ``@PREFIX at _ALIGNAS``
-# ``cxx_alignof``              ``@PREFIX at _ALIGNOF``
-# ``cxx_deleted_functions``    ``@PREFIX at _DISABLE_COPY``
-# ``cxx_noexcept``             ``@PREFIX at _NOEXCEPT_EXPR(X)``
-# ``cxx_nullptr``              ``@PREFIX at _NULLPTR``
-# ``cxx_static_assert``        ``@PREFIX at _STATIC_ASSERT``
-# ``cxx_static_assert``        ``@PREFIX at _STATIC_ASSERT_MSG``
-# ========================== ================================
+# ====================== ================================ ===================
+#         Feature                    Define                     Symbol
+# ====================== ================================ ===================
+# ``cxx_alignas``         ``<PREFIX>_ALIGNAS``             ``alignas``
+# ``cxx_alignof``         ``<PREFIX>_ALIGNOF``             ``alignof``
+# ``cxx_nullptr``         ``<PREFIX>_NULLPTR``             ``nullptr``
+# ``cxx_static_assert``   ``<PREFIX>_STATIC_ASSERT``       ``static_assert``
+# ``cxx_static_assert``   ``<PREFIX>_STATIC_ASSERT_MSG``   ``static_assert``
+# ====================== ================================ ===================
 
 
 #=============================================================================
@@ -249,7 +247,8 @@ function(write_compiler_detection_header
           "\n#    if !(${_cmake_oldestSupported_${compiler}})\n#      error Unsupported compiler version\n#    endif\n")
       set(pp_if "elif")
       foreach(feature ${${_lang}_features})
-        get_property(feature_PP GLOBAL PROPERTY CMAKE_PP_NAME_${feature})
+        string(TOUPPER ${feature} feature_upper)
+        set(feature_PP "COMPILER_${feature_upper}")
         set(_define_item "\n#    define ${prefix_arg}_${feature_PP} 0\n")
         if (_cmake_feature_test_${compiler}_${feature} STREQUAL "1")
           set(_define_item "\n#    define ${prefix_arg}_${feature_PP} 1\n")
@@ -264,26 +263,40 @@ function(write_compiler_detection_header
       file(APPEND "${file_arg}" "\n#  else\n#    error Unsupported compiler\n#  endif\n\n")
     endif()
     foreach(feature ${${_lang}_features})
-      get_property(symbol_define GLOBAL PROPERTY CMAKE_SYMBOL_DEFINE_${feature})
-      set(def_value ${symbol_define})
-      if (def_value)
-        get_property(feature_PP GLOBAL PROPERTY CMAKE_PP_NAME_${feature})
-        get_property(decl_PP GLOBAL PROPERTY CMAKE_PP_DECL_${feature})
-        set(def_name ${prefix_arg}_${decl_PP})
+      string(TOUPPER ${feature} feature_upper)
+      set(feature_PP "COMPILER_${feature_upper}")
+      set(def_name ${prefix_arg}_${feature_PP})
+      if (feature STREQUAL cxx_constexpr)
+        set(def_value "${prefix_arg}_DECL_${feature_upper}")
         file(APPEND "${file_arg}" "
-#  if ${prefix_arg}_${feature_PP}
-#    define ${def_name} ${def_value}
+#  if ${def_name}
+#    define ${def_value} constexpr
 #  else
-#    define ${def_name}
+#    define ${def_value}
+#  endif
+\n")
+      endif()
+      if (feature STREQUAL cxx_final)
+        set(def_value "${prefix_arg}_DECL_${feature_upper}")
+        file(APPEND "${file_arg}" "
+#  if ${def_name}
+#    define ${def_value} final
+#  else
+#    define ${def_value}
+#  endif
+\n")
+      endif()
+      if (feature STREQUAL cxx_override)
+        set(def_value "${prefix_arg}_DECL_${feature_upper}")
+        file(APPEND "${file_arg}" "
+#  if ${def_name}
+#    define ${def_value} override
+#  else
+#    define ${def_value}
 #  endif
 \n")
       endif()
-    endforeach()
-    foreach(feature ${${_lang}_features})
-      get_property(feature_PP GLOBAL PROPERTY CMAKE_PP_NAME_${feature})
       if (feature STREQUAL cxx_static_assert)
-        get_property(def_name GLOBAL PROPERTY CMAKE_PP_NAME_cxx_static_assert)
-        set(def_name ${prefix_arg}_${def_name})
         set(def_value "${prefix_arg}_STATIC_ASSERT(X)")
         set(def_value_msg "${prefix_arg}_STATIC_ASSERT_MSG(X, MSG)")
         set(static_assert_struct "template<bool> struct ${prefix_arg}StaticAssert;\ntemplate<> struct ${prefix_arg}StaticAssert<true>{};\n")
@@ -292,7 +305,6 @@ function(write_compiler_detection_header
         file(APPEND "${file_arg}" "#  if ${def_name}\n${def_standard}\n#  else\n${def_alternative}\n#  endif\n\n")
       endif()
       if (feature STREQUAL cxx_alignas)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_ALIGNAS(X)")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
@@ -305,7 +317,6 @@ function(write_compiler_detection_header
 \n")
       endif()
       if (feature STREQUAL cxx_alignof)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_ALIGNOF(X)")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
@@ -316,7 +327,6 @@ function(write_compiler_detection_header
 \n")
       endif()
       if (feature STREQUAL cxx_deleted_functions)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_DELETED_FUNCTION")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
@@ -324,15 +334,9 @@ function(write_compiler_detection_header
 #  else
 #    define ${def_value}
 #  endif
-
-#  define ${prefix_arg}_DISABLE_COPY(X) \\
-private: \\
-     X(X const&) ${prefix_arg}_DELETED_FUNCTION; \\
-     X& operator=(X const&) ${prefix_arg}_DELETED_FUNCTION;
 \n")
       endif()
       if (feature STREQUAL cxx_extern_templates)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_EXTERN_TEMPLATE")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
@@ -343,7 +347,6 @@ private: \\
 \n")
       endif()
       if (feature STREQUAL cxx_noexcept)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_NOEXCEPT")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
@@ -356,13 +359,12 @@ private: \\
 \n")
       endif()
       if (feature STREQUAL cxx_nullptr)
-        set(def_name ${prefix_arg}_${feature_PP})
         set(def_value "${prefix_arg}_NULLPTR")
         file(APPEND "${file_arg}" "
 #  if ${def_name}
 #    define ${def_value} nullptr
 #  else
-#    define ${def_value} (void*)0
+#    define ${def_value} static_cast<void*>(0)
 #  endif
 \n")
       endif()
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5518922..cd73c9a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2279,32 +2279,6 @@ const char *cmake::GetProperty(const std::string& prop,
     return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
 #undef STRING_LIST_ELEMENT
     }
-#define PP_FEATURE_NAME(F) \
-  if (prop == "CMAKE_PP_NAME_" #F) \
-    { \
-    static std::string val = ("COMPILER_" + cmSystemTools::UpperCase(#F)); \
-    return val.c_str(); \
-    }
-  FOR_EACH_CXX_FEATURE(PP_FEATURE_NAME)
-#undef PP_FEATURE_NAME
-
-#define FOR_EACH_CXX_DECL_FEATURE(F) \
-  F(final) \
-  F(override) \
-  F(constexpr)
-
-#define PP_DECL_NAME(F) \
-  if (prop == "CMAKE_PP_DECL_cxx_" #F) \
-    { \
-    static std::string val = ("DECL_CXX_" + cmSystemTools::UpperCase(#F)); \
-    return val.c_str(); \
-    } \
-  if (prop == "CMAKE_SYMBOL_DEFINE_cxx_" #F) \
-    { \
-    return #F; \
-    }
-  FOR_EACH_CXX_DECL_FEATURE(PP_DECL_NAME)
-#undef PP_DECL_NAME
 
   return this->Properties.GetPropertyValue(prop, scope, chain);
 }

-----------------------------------------------------------------------

Summary of changes:
 Modules/WriteCompilerDetectionHeader.cmake |  164 +++++++++++++++-------------
 Source/cmake.cxx                           |   26 -----
 2 files changed, 88 insertions(+), 102 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list