[Cmake-commits] CMake branch, master, updated. v3.10.0-rc3-145-g6a8c765

Kitware Robot kwrobot at kitware.com
Thu Oct 26 09:05:05 EDT 2017


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, master has been updated
       via  6a8c765c8f6a6a62efe4b10c54d748870525ce1a (commit)
       via  0278ec84d823b3d910cf5fc614b30b76984ac135 (commit)
       via  7077a554f14ad1cc5682d6bc8c2d05d1aff2a270 (commit)
       via  57132765e078a8654d1166d7d8a1c29ec01f47b4 (commit)
      from  6b829ff23dea13f5f70ea57b3594efd0726ff598 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a8c765c8f6a6a62efe4b10c54d748870525ce1a
commit 6a8c765c8f6a6a62efe4b10c54d748870525ce1a
Merge: 0278ec8 5713276
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 26 12:56:47 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Oct 26 08:57:04 2017 -0400

    Merge topic 'cm-array-begins-size'
    
    57132765 Replace cmArray{Begin,End,Size} by their standard counterparts
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1352


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0278ec84d823b3d910cf5fc614b30b76984ac135
commit 0278ec84d823b3d910cf5fc614b30b76984ac135
Merge: 6b829ff 7077a55
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 26 12:56:30 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Oct 26 08:56:37 2017 -0400

    Merge topic 'clang-cl-TP'
    
    7077a554 Clang: Use -TP flag for C++ sources with clang-cl
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1407


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7077a554f14ad1cc5682d6bc8c2d05d1aff2a270
commit 7077a554f14ad1cc5682d6bc8c2d05d1aff2a270
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Oct 25 07:27:43 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Oct 25 07:36:10 2017 -0400

    Clang: Use -TP flag for C++ sources with clang-cl
    
    We do this for `cl`, so we should do it for `clang-cl`.
    
    Fixes: #17394

diff --git a/Modules/Platform/Windows-Clang-CXX.cmake b/Modules/Platform/Windows-Clang-CXX.cmake
index 2c3688a..f1d40f2 100644
--- a/Modules/Platform/Windows-Clang-CXX.cmake
+++ b/Modules/Platform/Windows-Clang-CXX.cmake
@@ -1,2 +1,3 @@
 include(Platform/Windows-Clang)
+set(_COMPILE_CXX_MSVC " -TP")
 __windows_compiler_clang(CXX)
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index bcfda93..007ae53 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -12,6 +12,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
     OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   include(Platform/Windows-MSVC)
   macro(__windows_compiler_clang lang)
+    set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
     __windows_compiler_msvc(${lang})
   endmacro()
 else()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57132765e078a8654d1166d7d8a1c29ec01f47b4
commit 57132765e078a8654d1166d7d8a1c29ec01f47b4
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Thu Oct 5 12:43:06 2017 +0200
Commit:     Matthias Maennich <matthias at maennich.net>
CommitDate: Mon Oct 23 17:51:35 2017 +0200

    Replace cmArray{Begin,End,Size} by their standard counterparts
    
    std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14
    and an standard compliant implementation has been introduced within the
    'cm' namespace: cm::{cbegin,cend}.
    
    std::size is only part of C++17, hence exposing a compliant implementation
    within namespace cm (cm::size).
    
    where possible, the standard implementations are reused.

diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 69d0ed6..3380b78 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -43,22 +43,6 @@ inline bool cmHasLiteralSuffixImpl(const char* str1, const char* str2,
 }
 
 template <typename T, size_t N>
-const T* cmArrayBegin(const T (&a)[N])
-{
-  return a;
-}
-template <typename T, size_t N>
-const T* cmArrayEnd(const T (&a)[N])
-{
-  return a + N;
-}
-template <typename T, size_t N>
-size_t cmArraySize(const T (&)[N])
-{
-  return N;
-}
-
-template <typename T, size_t N>
 bool cmHasLiteralPrefix(const T& str1, const char (&str2)[N])
 {
   return cmHasLiteralPrefixImpl(str1, str2, N - 1);
@@ -418,6 +402,67 @@ std::unique_ptr<T> make_unique(Args&&... args)
 
 #endif
 
+#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
+
+using std::size;
+
+#else
+
+// std::size backport from C++17.
+template <class C>
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+constexpr
+#endif
+  auto
+  size(C const& c) -> decltype(c.size())
+{
+  return c.size();
+}
+
+template <typename T, size_t N>
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+constexpr
+#endif
+  std::size_t
+  size(const T (&)[N]) throw()
+{
+  return N;
+}
+
+#endif
+
+#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
+
+using std::cbegin;
+using std::cend;
+
+#else
+
+// std::c{begin,end} backport from C++14
+template <class C>
+#if defined(_MSC_VER) && _MSC_VER < 1900
+auto cbegin(C const& c)
+#else
+constexpr auto cbegin(C const& c) noexcept(noexcept(std::begin(c)))
+#endif
+  -> decltype(std::begin(c))
+{
+  return std::begin(c);
+}
+
+template <class C>
+#if defined(_MSC_VER) && _MSC_VER < 1900
+auto cend(C const& c)
+#else
+constexpr auto cend(C const& c) noexcept(noexcept(std::end(c)))
+#endif
+  -> decltype(std::end(c))
+{
+  return std::end(c);
+}
+
+#endif
+
 } // namespace cm
 
 #endif
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index fea20ba..7fe0cbe 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1035,7 +1035,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
         // No error. We just skip cyclic references.
         return std::string();
       case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
-        for (size_t i = 1; i < cmArraySize(targetPropertyTransitiveWhitelist);
+        for (size_t i = 1; i < cm::size(targetPropertyTransitiveWhitelist);
              ++i) {
           if (targetPropertyTransitiveWhitelist[i] == propertyName) {
             // No error. We're not going to find anything new here.
@@ -1443,7 +1443,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
     context->HadContextSensitiveCondition = true;
     context->HadHeadSensitiveCondition = true;
 
-    for (size_t i = 1; i < cmArraySize(targetPolicyWhitelist); ++i) {
+    for (size_t i = 1; i < cm::size(targetPolicyWhitelist); ++i) {
       const char* policy = targetPolicyWhitelist[i];
       if (parameters.front() == policy) {
         cmLocalGenerator* lg = context->HeadTarget->GetLocalGenerator();
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 38669c9..3f495da 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2519,8 +2519,8 @@ bool cmGlobalGenerator::IsReservedTarget(std::string const& name)
     "RUN_TESTS",  "package",   "PACKAGE",    "package_source", "ZERO_CHECK"
   };
 
-  return std::find(cmArrayBegin(reservedTargets), cmArrayEnd(reservedTargets),
-                   name) != cmArrayEnd(reservedTargets);
+  return std::find(cm::cbegin(reservedTargets), cm::cend(reservedTargets),
+                   name) != cm::cend(reservedTargets);
 }
 
 void cmGlobalGenerator::SetExternalMakefileProjectGenerator(
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1a088ea..12c0cfd 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -135,8 +135,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
     this->VariableMappings[compilerOptionSysroot] =
       this->Makefile->GetSafeDefinition(compilerOptionSysroot);
 
-    for (const char* const* replaceIter = cmArrayBegin(ruleReplaceVars);
-         replaceIter != cmArrayEnd(ruleReplaceVars); ++replaceIter) {
+    for (const char* const* replaceIter = cm::cbegin(ruleReplaceVars);
+         replaceIter != cm::cend(ruleReplaceVars); ++replaceIter) {
       std::string actualReplace = *replaceIter;
       if (actualReplace.find("${LANG}") != std::string::npos) {
         cmSystemTools::ReplaceString(actualReplace, "${LANG}", lang);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5643c97..66841b9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -7,6 +7,7 @@
 #include <algorithm>
 #include <assert.h>
 #include <ctype.h>
+#include <iterator>
 #include <memory> // IWYU pragma: keep
 #include <sstream>
 #include <stdlib.h>
@@ -4133,15 +4134,15 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
   assert(cmGeneratorExpression::Find(feature) == std::string::npos);
 
   bool isCFeature =
-    std::find_if(cmArrayBegin(C_FEATURES) + 1, cmArrayEnd(C_FEATURES),
-                 cmStrCmp(feature)) != cmArrayEnd(C_FEATURES);
+    std::find_if(cm::cbegin(C_FEATURES) + 1, cm::cend(C_FEATURES),
+                 cmStrCmp(feature)) != cm::cend(C_FEATURES);
   if (isCFeature) {
     lang = "C";
     return true;
   }
   bool isCxxFeature =
-    std::find_if(cmArrayBegin(CXX_FEATURES) + 1, cmArrayEnd(CXX_FEATURES),
-                 cmStrCmp(feature)) != cmArrayEnd(CXX_FEATURES);
+    std::find_if(cm::cbegin(CXX_FEATURES) + 1, cm::cend(CXX_FEATURES),
+                 cmStrCmp(feature)) != cm::cend(CXX_FEATURES);
   if (isCxxFeature) {
     lang = "CXX";
     return true;
@@ -4230,8 +4231,8 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
     // Return true so the caller does not try to lookup the default standard.
     return true;
   }
-  if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
-                   cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) {
+  if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
+                   cmStrCmp(defaultCStandard)) == cm::cend(C_STANDARDS)) {
     std::ostringstream e;
     e << "The CMAKE_C_STANDARD_DEFAULT variable contains an "
          "invalid value: \""
@@ -4251,8 +4252,8 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
     existingCStandard = defaultCStandard;
   }
 
-  if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
-                   cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) {
+  if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
+                   cmStrCmp(existingCStandard)) == cm::cend(C_STANDARDS)) {
     std::ostringstream e;
     e << "The C_STANDARD property on target \"" << target->GetName()
       << "\" contained an invalid value: \"" << existingCStandard << "\".";
@@ -4261,23 +4262,23 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
   }
 
   const char* const* existingCIt = existingCStandard
-    ? std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
+    ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
                    cmStrCmp(existingCStandard))
-    : cmArrayEnd(C_STANDARDS);
+    : cm::cend(C_STANDARDS);
 
   if (needC11 && existingCStandard &&
-      existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                 cmArrayEnd(C_STANDARDS), cmStrCmp("11"))) {
+      existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                 cm::cend(C_STANDARDS), cmStrCmp("11"))) {
     return false;
   }
   if (needC99 && existingCStandard &&
-      existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                 cmArrayEnd(C_STANDARDS), cmStrCmp("99"))) {
+      existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                 cm::cend(C_STANDARDS), cmStrCmp("99"))) {
     return false;
   }
   if (needC90 && existingCStandard &&
-      existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                 cmArrayEnd(C_STANDARDS), cmStrCmp("90"))) {
+      existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                 cm::cend(C_STANDARDS), cmStrCmp("90"))) {
     return false;
   }
   return true;
@@ -4289,16 +4290,16 @@ bool cmMakefile::IsLaterStandard(std::string const& lang,
 {
   if (lang == "C") {
     const char* const* rhsIt = std::find_if(
-      cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(rhs));
+      cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), cmStrCmp(rhs));
 
-    return std::find_if(rhsIt, cmArrayEnd(C_STANDARDS), cmStrCmp(lhs)) !=
-      cmArrayEnd(C_STANDARDS);
+    return std::find_if(rhsIt, cm::cend(C_STANDARDS), cmStrCmp(lhs)) !=
+      cm::cend(C_STANDARDS);
   }
   const char* const* rhsIt = std::find_if(
-    cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(rhs));
+    cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), cmStrCmp(rhs));
 
-  return std::find_if(rhsIt, cmArrayEnd(CXX_STANDARDS), cmStrCmp(lhs)) !=
-    cmArrayEnd(CXX_STANDARDS);
+  return std::find_if(rhsIt, cm::cend(CXX_STANDARDS), cmStrCmp(lhs)) !=
+    cm::cend(CXX_STANDARDS);
 }
 
 bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
@@ -4314,9 +4315,8 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
     // Return true so the caller does not try to lookup the default standard.
     return true;
   }
-  if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
-                   cmStrCmp(defaultCxxStandard)) ==
-      cmArrayEnd(CXX_STANDARDS)) {
+  if (std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
+                   cmStrCmp(defaultCxxStandard)) == cm::cend(CXX_STANDARDS)) {
     std::ostringstream e;
     e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an "
          "invalid value: \""
@@ -4337,9 +4337,8 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
     existingCxxStandard = defaultCxxStandard;
   }
 
-  if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
-                   cmStrCmp(existingCxxStandard)) ==
-      cmArrayEnd(CXX_STANDARDS)) {
+  if (std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
+                   cmStrCmp(existingCxxStandard)) == cm::cend(CXX_STANDARDS)) {
     std::ostringstream e;
     e << "The CXX_STANDARD property on target \"" << target->GetName()
       << "\" contained an invalid value: \"" << existingCxxStandard << "\".";
@@ -4348,32 +4347,28 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
   }
 
   const char* const* existingCxxIt = existingCxxStandard
-    ? std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
+    ? std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
                    cmStrCmp(existingCxxStandard))
-    : cmArrayEnd(CXX_STANDARDS);
+    : cm::cend(CXX_STANDARDS);
 
   if (needCxx17 &&
-      existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                   cmArrayEnd(CXX_STANDARDS),
-                                   cmStrCmp("17"))) {
+      existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                   cm::cend(CXX_STANDARDS), cmStrCmp("17"))) {
     return false;
   }
   if (needCxx14 &&
-      existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                   cmArrayEnd(CXX_STANDARDS),
-                                   cmStrCmp("14"))) {
+      existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                   cm::cend(CXX_STANDARDS), cmStrCmp("14"))) {
     return false;
   }
   if (needCxx11 &&
-      existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                   cmArrayEnd(CXX_STANDARDS),
-                                   cmStrCmp("11"))) {
+      existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                   cm::cend(CXX_STANDARDS), cmStrCmp("11"))) {
     return false;
   }
   if (needCxx98 &&
-      existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                   cmArrayEnd(CXX_STANDARDS),
-                                   cmStrCmp("98"))) {
+      existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                   cm::cend(CXX_STANDARDS), cmStrCmp("98"))) {
     return false;
   }
   return true;
@@ -4423,9 +4418,9 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
 
   const char* existingCxxStandard = target->GetProperty("CXX_STANDARD");
   if (existingCxxStandard) {
-    if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
+    if (std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
                      cmStrCmp(existingCxxStandard)) ==
-        cmArrayEnd(CXX_STANDARDS)) {
+        cm::cend(CXX_STANDARDS)) {
       std::ostringstream e;
       e << "The CXX_STANDARD property on target \"" << target->GetName()
         << "\" contained an invalid value: \"" << existingCxxStandard << "\".";
@@ -4439,9 +4434,9 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
     }
   }
   const char* const* existingCxxIt = existingCxxStandard
-    ? std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
+    ? std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
                    cmStrCmp(existingCxxStandard))
-    : cmArrayEnd(CXX_STANDARDS);
+    : cm::cend(CXX_STANDARDS);
 
   bool setCxx98 = needCxx98 && !existingCxxStandard;
   bool setCxx11 = needCxx11 && !existingCxxStandard;
@@ -4449,23 +4444,22 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
   bool setCxx17 = needCxx17 && !existingCxxStandard;
 
   if (needCxx17 && existingCxxStandard &&
-      existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                   cmArrayEnd(CXX_STANDARDS),
-                                   cmStrCmp("17"))) {
+      existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                   cm::cend(CXX_STANDARDS), cmStrCmp("17"))) {
     setCxx17 = true;
   } else if (needCxx14 && existingCxxStandard &&
-             existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                          cmArrayEnd(CXX_STANDARDS),
+             existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                          cm::cend(CXX_STANDARDS),
                                           cmStrCmp("14"))) {
     setCxx14 = true;
   } else if (needCxx11 && existingCxxStandard &&
-             existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                          cmArrayEnd(CXX_STANDARDS),
+             existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                          cm::cend(CXX_STANDARDS),
                                           cmStrCmp("11"))) {
     setCxx11 = true;
   } else if (needCxx98 && existingCxxStandard &&
-             existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
-                                          cmArrayEnd(CXX_STANDARDS),
+             existingCxxIt < std::find_if(cm::cbegin(CXX_STANDARDS),
+                                          cm::cend(CXX_STANDARDS),
                                           cmStrCmp("98"))) {
     setCxx98 = true;
   }
@@ -4522,8 +4516,8 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
 
   const char* existingCStandard = target->GetProperty("C_STANDARD");
   if (existingCStandard) {
-    if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
-                     cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) {
+    if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
+                     cmStrCmp(existingCStandard)) == cm::cend(C_STANDARDS)) {
       std::ostringstream e;
       e << "The C_STANDARD property on target \"" << target->GetName()
         << "\" contained an invalid value: \"" << existingCStandard << "\".";
@@ -4537,26 +4531,26 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
     }
   }
   const char* const* existingCIt = existingCStandard
-    ? std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
+    ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
                    cmStrCmp(existingCStandard))
-    : cmArrayEnd(C_STANDARDS);
+    : cm::cend(C_STANDARDS);
 
   bool setC90 = needC90 && !existingCStandard;
   bool setC99 = needC99 && !existingCStandard;
   bool setC11 = needC11 && !existingCStandard;
 
   if (needC11 && existingCStandard &&
-      existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                 cmArrayEnd(C_STANDARDS), cmStrCmp("11"))) {
+      existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                 cm::cend(C_STANDARDS), cmStrCmp("11"))) {
     setC11 = true;
   } else if (needC99 && existingCStandard &&
-             existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                        cmArrayEnd(C_STANDARDS),
+             existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                        cm::cend(C_STANDARDS),
                                         cmStrCmp("99"))) {
     setC99 = true;
   } else if (needC90 && existingCStandard &&
-             existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
-                                        cmArrayEnd(C_STANDARDS),
+             existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
+                                        cm::cend(C_STANDARDS),
                                         cmStrCmp("90"))) {
     setC90 = true;
   }
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 5e89978..9dc77ac 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -9,6 +9,7 @@
 #include "cmsys/RegularExpression.hxx"
 
 #include <algorithm>
+#include <iterator>
 #include <sstream>
 #include <stddef.h>
 
@@ -301,8 +302,7 @@ std::string cmQtAutoGen::Quoted(std::string const& text)
                                  "\r", "\\r",  "\t", "\\t",  "\v", "\\v" };
 
   std::string res = text;
-  for (const char* const* it = cmArrayBegin(rep); it != cmArrayEnd(rep);
-       it += 2) {
+  for (const char* const* it = cm::cbegin(rep); it != cm::cend(rep); it += 2) {
     cmSystemTools::ReplaceString(res, *it, *(it + 1));
   }
   res = '"' + res;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1a1b1e2..0a303b0 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -15,6 +15,7 @@
 #include "cmVisualStudioGeneratorOptions.h"
 #include "windows.h"
 
+#include <iterator>
 #include <memory> // IWYU pragma: keep
 
 static std::string cmVS10EscapeXML(std::string arg)
@@ -2368,14 +2369,14 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   // Choose a language whose flags to use for ClCompile.
   static const char* clLangs[] = { "CXX", "C", "Fortran", "CSharp" };
   std::string langForClCompile;
-  if (std::find(cmArrayBegin(clLangs), cmArrayEnd(clLangs), linkLanguage) !=
-      cmArrayEnd(clLangs)) {
+  if (std::find(cm::cbegin(clLangs), cm::cend(clLangs), linkLanguage) !=
+      cm::cend(clLangs)) {
     langForClCompile = linkLanguage;
   } else {
     std::set<std::string> languages;
     this->GeneratorTarget->GetLanguages(languages, configName);
-    for (const char* const* l = cmArrayBegin(clLangs);
-         l != cmArrayEnd(clLangs); ++l) {
+    for (const char* const* l = cm::cbegin(clLangs); l != cm::cend(clLangs);
+         ++l) {
       if (languages.find(*l) != languages.end()) {
         langForClCompile = *l;
         break;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d7ed772..087058e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -110,6 +110,7 @@
 #include "cmsys/RegularExpression.hxx"
 #include <algorithm>
 #include <iostream>
+#include <iterator>
 #include <memory> // IWYU pragma: keep
 #include <sstream>
 #include <stdio.h>
@@ -1453,12 +1454,12 @@ void cmake::CreateDefaultGlobalGenerator()
   if (vsSetupAPIHelper.IsVS2017Installed()) {
     found = "Visual Studio 15 2017";
   } else {
-    for (VSVersionedGenerator const* g = cmArrayBegin(vsGenerators);
-         found.empty() && g != cmArrayEnd(vsGenerators); ++g) {
-      for (const char* const* v = cmArrayBegin(vsVariants);
-           found.empty() && v != cmArrayEnd(vsVariants); ++v) {
-        for (const char* const* e = cmArrayBegin(vsEntries);
-             found.empty() && e != cmArrayEnd(vsEntries); ++e) {
+    for (VSVersionedGenerator const* g = cm::cbegin(vsGenerators);
+         found.empty() && g != cm::cend(vsGenerators); ++g) {
+      for (const char* const* v = cm::cbegin(vsVariants);
+           found.empty() && v != cm::cend(vsVariants); ++v) {
+        for (const char* const* e = cm::cbegin(vsEntries);
+             found.empty() && e != cm::cend(vsEntries); ++e) {
           std::string const reg = vsregBase + *v + g->MSVersion + *e;
           std::string dir;
           if (cmSystemTools::ReadRegistryValue(reg, dir,
@@ -1716,8 +1717,8 @@ bool cmake::LoadCache(const std::string& path, bool internal,
   bool result = this->State->LoadCache(path, internal, excludes, includes);
   static const char* entries[] = { "CMAKE_CACHE_MAJOR_VERSION",
                                    "CMAKE_CACHE_MINOR_VERSION" };
-  for (const char* const* nameIt = cmArrayBegin(entries);
-       nameIt != cmArrayEnd(entries); ++nameIt) {
+  for (const char* const* nameIt = cm::cbegin(entries);
+       nameIt != cm::cend(entries); ++nameIt) {
     this->UnwatchUnusedCli(*nameIt);
   }
   return result;
@@ -1730,8 +1731,8 @@ bool cmake::SaveCache(const std::string& path)
                                    "CMAKE_CACHE_MINOR_VERSION",
                                    "CMAKE_CACHE_PATCH_VERSION",
                                    "CMAKE_CACHEFILE_DIR" };
-  for (const char* const* nameIt = cmArrayBegin(entries);
-       nameIt != cmArrayEnd(entries); ++nameIt) {
+  for (const char* const* nameIt = cm::cbegin(entries);
+       nameIt != cm::cend(entries); ++nameIt) {
     this->UnwatchUnusedCli(*nameIt);
   }
   return result;
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ed507fd..4810cd0 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -35,6 +35,7 @@
 #include <algorithm>
 #include <functional>
 #include <iostream>
+#include <iterator>
 #include <map>
 #include <memory> // IWYU pragma: keep
 #include <sstream>
@@ -1013,8 +1014,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
           } else if (cmHasLiteralPrefix(arg, "--format=")) {
             format = arg.substr(9);
             bool isKnown =
-              std::find(cmArrayBegin(knownFormats), cmArrayEnd(knownFormats),
-                        format) != cmArrayEnd(knownFormats);
+              std::find(cm::cbegin(knownFormats), cm::cend(knownFormats),
+                        format) != cm::cend(knownFormats);
 
             if (!isKnown) {
               cmSystemTools::Error("Unknown -E tar --format= argument: ",

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

Summary of changes:
 Modules/Platform/Windows-Clang-CXX.cmake   |    1 +
 Modules/Platform/Windows-Clang.cmake       |    1 +
 Source/cmAlgorithms.h                      |   77 +++++++++++++----
 Source/cmGeneratorExpressionNode.cxx       |    4 +-
 Source/cmGlobalGenerator.cxx               |    4 +-
 Source/cmLocalGenerator.cxx                |    4 +-
 Source/cmMakefile.cxx                      |  124 +++++++++++++---------------
 Source/cmQtAutoGen.cxx                     |    4 +-
 Source/cmVisualStudio10TargetGenerator.cxx |    9 +-
 Source/cmake.cxx                           |   21 ++---
 Source/cmcmd.cxx                           |    5 +-
 11 files changed, 149 insertions(+), 105 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list