[Cmake-commits] CMake branch, master, updated. v3.14.0-rc4-315-gec459c1

Kitware Robot kwrobot at kitware.com
Fri Mar 8 09:43:05 EST 2019


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  ec459c10c46c149f6938c852b4bd0295975cec50 (commit)
       via  42bbde4193537ac9e9e955304ef63ed696c2c225 (commit)
       via  18ff7cc34f5769bd14ba2893b54647f9b639f847 (commit)
       via  8145876a1f17eb13878d6b9e0f45662e8873fddf (commit)
       via  9b2665fc2cee185fe7ceaf767c4a39c1d9749219 (commit)
       via  adba2945b301ae1bc35dfbc70125654c8db237a7 (commit)
       via  58426958ab159ed1f05f6425f914f969dc954e25 (commit)
       via  6ae5fffd0f91632ff9c80bf6c28620fa5ff57eb3 (commit)
       via  538e699e5a981012181e2f1a76a96848fef50caa (commit)
       via  bf1e73305ac1b6bc9021b80fc8da99fda032c018 (commit)
       via  d53317130e84898c5328c237186dbd995aaf1c12 (commit)
      from  89215c8ccfdb3d38cfe59b8bc5c684c9a48a9cc0 (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=ec459c10c46c149f6938c852b4bd0295975cec50
commit ec459c10c46c149f6938c852b4bd0295975cec50
Merge: 42bbde4 6ae5fff
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 14:35:30 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 8 09:39:43 2019 -0500

    Merge topic 'optimize-properties-processing'
    
    6ae5fffd0f Optimize target properties processing at generation step
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3062


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42bbde4193537ac9e9e955304ef63ed696c2c225
commit 42bbde4193537ac9e9e955304ef63ed696c2c225
Merge: 18ff7cc bf1e733
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 14:35:25 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 8 09:38:54 2019 -0500

    Merge topic 'cmalgorithm-modernize-cmremoveduplicates'
    
    bf1e73305a cmAlgorithms: Refactor cmRemoveDuplicates
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3029


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18ff7cc34f5769bd14ba2893b54647f9b639f847
commit 18ff7cc34f5769bd14ba2893b54647f9b639f847
Merge: 8145876 538e699
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 14:35:37 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 8 09:37:56 2019 -0500

    Merge topic 'enable_testing'
    
    538e699e5a Help: for command enable_testing, explain relation to module CTest.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3070


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8145876a1f17eb13878d6b9e0f45662e8873fddf
commit 8145876a1f17eb13878d6b9e0f45662e8873fddf
Merge: 9b2665f d533171
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 14:35:33 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 8 09:36:35 2019 -0500

    Merge topic 'find-pthread-update'
    
    d53317130e FindThreads: Use complete program to test for pthreads in libc
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3040


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b2665fc2cee185fe7ceaf767c4a39c1d9749219
commit 9b2665fc2cee185fe7ceaf767c4a39c1d9749219
Merge: 89215c8 adba294
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 14:35:18 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 8 09:35:28 2019 -0500

    Merge topic 'win-rel-qt5.12'
    
    adba2945b3 Utilities/Release: Update to Qt 5.12 on Windows builds
    58426958ab Utilities/Release: Update for using Windows 10 SDK
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3079


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=adba2945b301ae1bc35dfbc70125654c8db237a7
commit adba2945b301ae1bc35dfbc70125654c8db237a7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 07:14:15 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 8 07:23:55 2019 -0500

    Utilities/Release: Update to Qt 5.12 on Windows builds

diff --git a/Utilities/Release/win32_release.cmake b/Utilities/Release/win32_release.cmake
index e76e333..1e4421c 100644
--- a/Utilities/Release/win32_release.cmake
+++ b/Utilities/Release/win32_release.cmake
@@ -8,12 +8,16 @@ set(CPACK_BINARY_GENERATORS "WIX ZIP")
 set(CPACK_SOURCE_GENERATORS "ZIP")
 set(MAKE_PROGRAM "ninja")
 set(MAKE "${MAKE_PROGRAM} -j16")
-set(qt_prefix "c:/Qt/5.6.3/msvc2017-32-xp-mt")
+set(qt_prefix "c:/Qt/5.12.1/msvc2017-32-w7-mt")
 set(qt_win_libs
   ${qt_prefix}/plugins/platforms/qwindows.lib
-  ${qt_prefix}/lib/Qt5PlatformSupport.lib
+  ${qt_prefix}/lib/Qt5EventDispatcherSupport.lib
+  ${qt_prefix}/lib/Qt5FontDatabaseSupport.lib
+  ${qt_prefix}/lib/Qt5ThemeSupport.lib
   ${qt_prefix}/lib/qtfreetype.lib
+  ${qt_prefix}/lib/qtlibpng.lib
   imm32.lib
+  wtsapi32.lib
   )
 set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
 CMAKE_DOC_DIR:STRING=doc/cmake
diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake
index 511f0a3..98eaf19 100644
--- a/Utilities/Release/win64_release.cmake
+++ b/Utilities/Release/win64_release.cmake
@@ -8,12 +8,16 @@ set(CPACK_BINARY_GENERATORS "WIX ZIP")
 set(CPACK_SOURCE_GENERATORS "")
 set(MAKE_PROGRAM "ninja")
 set(MAKE "${MAKE_PROGRAM} -j16")
-set(qt_prefix "c:/Qt/5.6.3/msvc2017-64-xp-mt")
+set(qt_prefix "c:/Qt/5.12.1/msvc2017-64-w7-mt")
 set(qt_win_libs
   ${qt_prefix}/plugins/platforms/qwindows.lib
-  ${qt_prefix}/lib/Qt5PlatformSupport.lib
+  ${qt_prefix}/lib/Qt5EventDispatcherSupport.lib
+  ${qt_prefix}/lib/Qt5FontDatabaseSupport.lib
+  ${qt_prefix}/lib/Qt5ThemeSupport.lib
   ${qt_prefix}/lib/qtfreetype.lib
+  ${qt_prefix}/lib/qtlibpng.lib
   imm32.lib
+  wtsapi32.lib
   )
 set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release
 CMAKE_DOC_DIR:STRING=doc/cmake

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58426958ab159ed1f05f6425f914f969dc954e25
commit 58426958ab159ed1f05f6425f914f969dc954e25
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 8 07:07:46 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 8 07:23:55 2019 -0500

    Utilities/Release: Update for using Windows 10 SDK
    
    In commit e903a9fc55 (Utilities/Release: Create a Windows 64-bit binary,
    2016-03-16, v3.6.0-rc1~235^2~2) we added a `_USING_V110_SDK71_` macro to
    tell the MSVC standard library headers they were using an older SDK.
    The environment in which our Windows binaries are produced has been
    updated to use a Windows 10 SDK now that we do not need to support
    WinXP, so we can drop the definition.

diff --git a/Utilities/Release/win32_release.cmake b/Utilities/Release/win32_release.cmake
index c03c665..e76e333 100644
--- a/Utilities/Release/win32_release.cmake
+++ b/Utilities/Release/win32_release.cmake
@@ -31,7 +31,7 @@ CMAKE_PREFIX_PATH:STRING=${qt_prefix}
 CMake_TEST_Qt4:BOOL=OFF
 CMake_TEST_Qt5:BOOL=OFF
 ")
-set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000 -D_USING_V110_SDK71_")
+set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000")
 set(CFLAGS "${ppflags}")
 set(CXXFLAGS "${ppflags}")
 set(ENV ". ~/rel/env32")
diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake
index 8417206..511f0a3 100644
--- a/Utilities/Release/win64_release.cmake
+++ b/Utilities/Release/win64_release.cmake
@@ -31,7 +31,7 @@ CMAKE_PREFIX_PATH:STRING=${qt_prefix}
 CMake_TEST_Qt4:BOOL=OFF
 CMake_TEST_Qt5:BOOL=OFF
 ")
-set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000 -D_USING_V110_SDK71_")
+set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000")
 set(CFLAGS "${ppflags}")
 set(CXXFLAGS "${ppflags}")
 set(ENV ". ~/rel/env64")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ae5fffd0f91632ff9c80bf6c28620fa5ff57eb3
commit 6ae5fffd0f91632ff9c80bf6c28620fa5ff57eb3
Author:     Marc Chevrier <marc.chevrier at gmail.com>
AuthorDate: Tue Mar 5 11:36:27 2019 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Mar 7 09:25:43 2019 -0500

    Optimize target properties processing at generation step
    
    Avoid creating unnecessary `cmCompileGeneratorExpression` instances.
    Use runtime polymorphism to avoid the full genex infrastructure when a
    property value does not contain a genex.
    
    Issue: #18965

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 624333c..5916fcc 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -65,20 +65,137 @@ const char* cmTargetPropertyComputer::ComputeLocation<cmGeneratorTarget>(
 
 class cmGeneratorTarget::TargetPropertyEntry
 {
+protected:
   static cmLinkImplItem NoLinkImplItem;
 
 public:
-  TargetPropertyEntry(std::unique_ptr<cmCompiledGeneratorExpression> cge,
-                      cmLinkImplItem const& item = NoLinkImplItem)
-    : ge(std::move(cge))
-    , LinkImplItem(item)
+  TargetPropertyEntry(cmLinkImplItem const& item)
+    : LinkImplItem(item)
   {
   }
-  const std::unique_ptr<cmCompiledGeneratorExpression> ge;
+  virtual ~TargetPropertyEntry() = default;
+
+  virtual const std::string& Evaluate(
+    cmLocalGenerator* lg, const std::string& config, bool quiet = false,
+    cmGeneratorTarget const* headTarget = nullptr,
+    cmGeneratorTarget const* currentTarget = nullptr,
+    cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
+    std::string const& language = std::string()) const = 0;
+  virtual const std::string& Evaluate(
+    cmLocalGenerator* lg, const std::string& config, bool quiet,
+    cmGeneratorTarget const* headTarget,
+    cmGeneratorExpressionDAGChecker* dagChecker,
+    std::string const& language = std::string()) const = 0;
+
+  virtual cmListFileBacktrace GetBacktrace() const = 0;
+  virtual std::string const& GetInput() const = 0;
+  virtual bool GetHadContextSensitiveCondition() const { return false; }
+
   cmLinkImplItem const& LinkImplItem;
+
+private:
+  cmListFileBacktrace Backtrace;
 };
 cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
 
+class TargetPropertyEntryGenex : public cmGeneratorTarget::TargetPropertyEntry
+{
+public:
+  TargetPropertyEntryGenex(std::unique_ptr<cmCompiledGeneratorExpression> cge,
+                           cmLinkImplItem const& item = NoLinkImplItem)
+    : cmGeneratorTarget::TargetPropertyEntry(item)
+    , ge(std::move(cge))
+  {
+  }
+
+  const std::string& Evaluate(
+    cmLocalGenerator* lg, const std::string& config, bool quiet = false,
+    cmGeneratorTarget const* headTarget = nullptr,
+    cmGeneratorTarget const* currentTarget = nullptr,
+    cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
+    std::string const& language = std::string()) const override
+  {
+    return this->ge->Evaluate(lg, config, quiet, headTarget, currentTarget,
+                              dagChecker, language);
+  }
+  const std::string& Evaluate(
+    cmLocalGenerator* lg, const std::string& config, bool quiet,
+    cmGeneratorTarget const* headTarget,
+    cmGeneratorExpressionDAGChecker* dagChecker,
+    std::string const& language = std::string()) const override
+  {
+    return this->ge->Evaluate(lg, config, quiet, headTarget, dagChecker,
+                              language);
+  }
+
+  cmListFileBacktrace GetBacktrace() const override
+  {
+    return this->ge->GetBacktrace();
+  }
+
+  std::string const& GetInput() const override { return this->ge->GetInput(); }
+
+  bool GetHadContextSensitiveCondition() const override
+  {
+    return this->ge->GetHadContextSensitiveCondition();
+  }
+
+private:
+  const std::unique_ptr<cmCompiledGeneratorExpression> ge;
+};
+
+class TargetPropertyEntryString : public cmGeneratorTarget::TargetPropertyEntry
+{
+public:
+  TargetPropertyEntryString(std::string propertyValue,
+                            cmListFileBacktrace backtrace,
+                            cmLinkImplItem const& item = NoLinkImplItem)
+    : cmGeneratorTarget::TargetPropertyEntry(item)
+    , PropertyValue(std::move(propertyValue))
+    , Backtrace(std::move(backtrace))
+  {
+  }
+
+  const std::string& Evaluate(cmLocalGenerator*, const std::string&, bool,
+                              cmGeneratorTarget const*,
+                              cmGeneratorTarget const*,
+                              cmGeneratorExpressionDAGChecker*,
+                              std::string const&) const override
+  {
+    return this->PropertyValue;
+  }
+  const std::string& Evaluate(cmLocalGenerator*, const std::string&, bool,
+                              cmGeneratorTarget const*,
+                              cmGeneratorExpressionDAGChecker*,
+                              std::string const&) const override
+  {
+    return this->PropertyValue;
+  }
+
+  cmListFileBacktrace GetBacktrace() const override { return this->Backtrace; }
+  std::string const& GetInput() const override { return this->PropertyValue; }
+
+private:
+  std::string PropertyValue;
+  cmListFileBacktrace Backtrace;
+};
+
+cmGeneratorTarget::TargetPropertyEntry* CreateTargetPropertyEntry(
+  const std::string& propertyValue,
+  cmListFileBacktrace backtrace = cmListFileBacktrace(),
+  bool evaluateForBuildsystem = false)
+{
+  if (cmGeneratorExpression::Find(propertyValue) != std::string::npos) {
+    cmGeneratorExpression ge(std::move(backtrace));
+    std::unique_ptr<cmCompiledGeneratorExpression> cge =
+      ge.Parse(propertyValue);
+    cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
+    return new TargetPropertyEntryGenex(std::move(cge));
+  }
+
+  return new TargetPropertyEntryString(propertyValue, backtrace);
+}
+
 void CreatePropertyGeneratorExpressions(
   cmStringRange entries, cmBacktraceRange backtraces,
   std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items,
@@ -87,11 +204,8 @@ void CreatePropertyGeneratorExpressions(
   std::vector<cmListFileBacktrace>::const_iterator btIt = backtraces.begin();
   for (std::vector<std::string>::const_iterator it = entries.begin();
        it != entries.end(); ++it, ++btIt) {
-    cmGeneratorExpression ge(*btIt);
-    std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
-    cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
     items.push_back(
-      new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
+      CreateTargetPropertyEntry(*it, *btIt, evaluateForBuildsystem));
   }
 }
 
@@ -167,7 +281,7 @@ const char* cmGeneratorTarget::GetSourcesProperty() const
 {
   std::vector<std::string> values;
   for (TargetPropertyEntry* se : this->SourceEntries) {
-    values.push_back(se->ge->GetInput());
+    values.push_back(se->GetInput());
   }
   static std::string value;
   value.clear();
@@ -359,13 +473,9 @@ void cmGeneratorTarget::ClearSourcesCache()
 
 void cmGeneratorTarget::AddSourceCommon(const std::string& src, bool before)
 {
-  cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-  cmGeneratorExpression ge(lfbt);
-  std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
-  cge->SetEvaluateForBuildsystem(true);
-  this->SourceEntries.insert(before ? this->SourceEntries.begin()
-                                    : this->SourceEntries.end(),
-                             new TargetPropertyEntry(std::move(cge)));
+  this->SourceEntries.insert(
+    before ? this->SourceEntries.begin() : this->SourceEntries.end(),
+    CreateTargetPropertyEntry(src, this->Makefile->GetBacktrace(), true));
   this->ClearSourcesCache();
 }
 
@@ -387,14 +497,10 @@ void cmGeneratorTarget::AddIncludeDirectory(const std::string& src,
                                             bool before)
 {
   this->Target->InsertInclude(src, this->Makefile->GetBacktrace(), before);
-  cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-  cmGeneratorExpression ge(lfbt);
-  std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
-  cge->SetEvaluateForBuildsystem(true);
   this->IncludeDirectoriesEntries.insert(
     before ? this->IncludeDirectoriesEntries.begin()
            : this->IncludeDirectoriesEntries.end(),
-    new TargetPropertyEntry(std::move(cge)));
+    CreateTargetPropertyEntry(src, this->Makefile->GetBacktrace(), true));
 }
 
 std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
@@ -854,8 +960,7 @@ static void AddInterfaceEntries(
         cmGeneratorExpression ge(lib.Backtrace);
         std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
         cge->SetEvaluateForBuildsystem(true);
-        entries.push_back(
-          new cmGeneratorTarget::TargetPropertyEntry(std::move(cge), lib));
+        entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib));
       }
     }
   }
@@ -877,8 +982,7 @@ static void AddObjectEntries(
         cmGeneratorExpression ge(lib.Backtrace);
         std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
         cge->SetEvaluateForBuildsystem(true);
-        entries.push_back(
-          new cmGeneratorTarget::TargetPropertyEntry(std::move(cge), lib));
+        entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib));
       }
     }
   }
@@ -900,12 +1004,12 @@ static bool processSources(
     cmLinkImplItem const& item = entry->LinkImplItem;
     std::string const& targetName = item.AsStr();
     std::vector<std::string> entrySources;
-    cmSystemTools::ExpandListArgument(
-      entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, tgt,
-                          dagChecker),
-      entrySources);
+    cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(),
+                                                      config, false, tgt, tgt,
+                                                      dagChecker),
+                                      entrySources);
 
-    if (entry->ge->GetHadContextSensitiveCondition()) {
+    if (entry->GetHadContextSensitiveCondition()) {
       contextDependent = true;
     }
 
@@ -940,7 +1044,7 @@ static bool processSources(
     std::string usedSources;
     for (std::string const& src : entrySources) {
       if (uniqueSrcs.insert(src).second) {
-        srcs.emplace_back(src, entry->ge->GetBacktrace());
+        srcs.emplace_back(src, entry->GetBacktrace());
         if (debugSources) {
           usedSources += " * " + src + "\n";
         }
@@ -951,7 +1055,7 @@ static bool processSources(
         MessageType::LOG,
         std::string("Used sources for target ") + tgt->GetName() + ":\n" +
           usedSources,
-        entry->ge->GetBacktrace());
+        entry->GetBacktrace());
     }
   }
   return contextDependent;
@@ -2529,10 +2633,10 @@ static void processIncludeDirectories(
     bool const fromImported = item.Target && item.Target->IsImported();
     bool const checkCMP0027 = item.FromGenex;
     std::vector<std::string> entryIncludes;
-    cmSystemTools::ExpandListArgument(
-      entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt,
-                          dagChecker, language),
-      entryIncludes);
+    cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(),
+                                                      config, false, tgt,
+                                                      dagChecker, language),
+                                      entryIncludes);
 
     std::string usedIncludes;
     for (std::string& entryInclude : entryIncludes) {
@@ -2610,7 +2714,7 @@ static void processIncludeDirectories(
       std::string inc = entryInclude;
 
       if (uniqueIncludes.insert(inc).second) {
-        includes.emplace_back(inc, entry->ge->GetBacktrace());
+        includes.emplace_back(inc, entry->GetBacktrace());
         if (debugIncludes) {
           usedIncludes += " * " + inc + "\n";
         }
@@ -2621,7 +2725,7 @@ static void processIncludeDirectories(
         MessageType::LOG,
         std::string("Used includes for target ") + tgt->GetName() + ":\n" +
           usedIncludes,
-        entry->ge->GetBacktrace());
+        entry->GetBacktrace());
     }
   }
 }
@@ -2673,11 +2777,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
 
       libDir = frameworkCheck.match(1);
 
-      cmGeneratorExpression ge;
-      std::unique_ptr<cmCompiledGeneratorExpression> cge =
-        ge.Parse(libDir.c_str());
       linkInterfaceIncludeDirectoriesEntries.push_back(
-        new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
+        CreateTargetPropertyEntry(libDir));
     }
   }
 
@@ -2707,10 +2808,10 @@ static void processOptionsInternal(
 {
   for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) {
     std::vector<std::string> entryOptions;
-    cmSystemTools::ExpandListArgument(
-      entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt,
-                          dagChecker, language),
-      entryOptions);
+    cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(),
+                                                      config, false, tgt,
+                                                      dagChecker, language),
+                                      entryOptions);
     std::string usedOptions;
     for (std::string const& opt : entryOptions) {
       if (uniqueOptions.insert(opt).second) {
@@ -2719,10 +2820,10 @@ static void processOptionsInternal(
           std::vector<std::string> tmp;
           cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp);
           for (std::string& o : tmp) {
-            options.emplace_back(std::move(o), entry->ge->GetBacktrace());
+            options.emplace_back(std::move(o), entry->GetBacktrace());
           }
         } else {
-          options.emplace_back(opt, entry->ge->GetBacktrace());
+          options.emplace_back(opt, entry->GetBacktrace());
         }
         if (debugOptions) {
           usedOptions += " * " + opt + "\n";
@@ -2734,7 +2835,7 @@ static void processOptionsInternal(
         MessageType::LOG,
         std::string("Used ") + logName + std::string(" for target ") +
           tgt->GetName() + ":\n" + usedOptions,
-        entry->ge->GetBacktrace());
+        entry->GetBacktrace());
     }
   }
 }
@@ -2938,11 +3039,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions(
           CM_FALLTHROUGH;
         }
         case cmPolicies::OLD: {
-          cmGeneratorExpression ge;
-          std::unique_ptr<cmCompiledGeneratorExpression> cge =
-            ge.Parse(configProp);
           linkInterfaceCompileDefinitionsEntries.push_back(
-            new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
+            CreateTargetPropertyEntry(configProp));
         } break;
         case cmPolicies::NEW:
         case cmPolicies::REQUIRED_ALWAYS:
@@ -3168,12 +3266,9 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions(
 
   if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
     std::vector<std::string> options;
-    cmGeneratorExpression ge;
     cmSystemTools::ExpandListArgument(linkOptions, options);
     for (const auto& option : options) {
-      std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(option);
-      entries.push_back(
-        new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
+      entries.push_back(CreateTargetPropertyEntry(option));
     }
   }
   processStaticLibraryLinkOptions(this, entries, result, uniqueOptions,
@@ -3197,10 +3292,10 @@ void processLinkDirectories(
     std::string const& targetName = item.AsStr();
 
     std::vector<std::string> entryDirectories;
-    cmSystemTools::ExpandListArgument(
-      entry->ge->Evaluate(tgt->GetLocalGenerator(), config, false, tgt,
-                          dagChecker, language),
-      entryDirectories);
+    cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(),
+                                                      config, false, tgt,
+                                                      dagChecker, language),
+                                      entryDirectories);
 
     std::string usedDirectories;
     for (std::string& entryDirectory : entryDirectories) {
@@ -3256,7 +3351,7 @@ void processLinkDirectories(
         MessageType::LOG,
         std::string("Used link directories for target ") + tgt->GetName() +
           ":\n" + usedDirectories,
-        entry->ge->GetBacktrace());
+        entry->GetBacktrace());
     }
   }
 }
@@ -3353,12 +3448,9 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends(
 
   if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) {
     std::vector<std::string> depends;
-    cmGeneratorExpression ge;
     cmSystemTools::ExpandListArgument(linkDepends, depends);
     for (const auto& depend : depends) {
-      std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depend);
-      linkDependsEntries.push_back(
-        new cmGeneratorTarget::TargetPropertyEntry(std::move(cge)));
+      linkDependsEntries.push_back(CreateTargetPropertyEntry(depend));
     }
   }
   AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS",

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=538e699e5a981012181e2f1a76a96848fef50caa
commit 538e699e5a981012181e2f1a76a96848fef50caa
Author:     Joachim Wuttke (o) <j.wuttke at fz-juelich.de>
AuthorDate: Thu Mar 7 11:58:22 2019 +0100
Commit:     Joachim Wuttke (o) <j.wuttke at fz-juelich.de>
CommitDate: Thu Mar 7 11:58:22 2019 +0100

    Help: for command enable_testing, explain relation to module CTest.

diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index a8c257d..46b9b63 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -55,7 +55,8 @@ file produced by target ``myexe``.
 
   CMake will generate tests only if the :command:`enable_testing`
   command has been invoked.  The :module:`CTest` module invokes the
-  command automatically when the ``BUILD_TESTING`` option is ``ON``.
+  command automatically unless the ``BUILD_TESTING`` option is turned
+  ``OFF``.
 
 ---------------------------------------------------------------------
 
diff --git a/Help/command/enable_testing.rst b/Help/command/enable_testing.rst
index e2028d2..3ac1a19 100644
--- a/Help/command/enable_testing.rst
+++ b/Help/command/enable_testing.rst
@@ -7,7 +7,14 @@ Enable testing for current directory and below.
 
   enable_testing()
 
-Enables testing for this directory and below.  See also the
-:command:`add_test` command.  Note that ctest expects to find a test file
-in the build directory root.  Therefore, this command should be in the
-source directory root.
+Enables testing for this directory and below.
+
+This command should be in the source directory root
+because ctest expects to find a test file in the build
+directory root.
+
+This command is automatically invoked when the :module:`CTest`
+module is included, except if the ``BUILD_TESTING`` option is
+turned off.
+
+See also the :command:`add_test` command.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf1e73305ac1b6bc9021b80fc8da99fda032c018
commit bf1e73305ac1b6bc9021b80fc8da99fda032c018
Author:     Artur Ryt <artur.ryt at gmail.com>
AuthorDate: Sun Mar 3 14:19:18 2019 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 6 08:57:47 2019 -0500

    cmAlgorithms: Refactor cmRemoveDuplicates
    
    Use an iterator-based implementation with range-based one simply
    deferring to it.
    
    Also optimize a little by storing iterators to unique values to prevent
    creating value copies.

diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 2ff1ed0..0980416 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -233,27 +233,45 @@ typename Range::const_iterator cmRemoveMatching(Range& r, MatchRange const& m)
                         ContainerAlgorithms::BinarySearcher<MatchRange>(m));
 }
 
-template <typename Range>
-typename Range::const_iterator cmRemoveDuplicates(Range& r)
+template <typename ForwardIterator>
+ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last)
 {
-  typedef typename Range::value_type T;
-  std::unordered_set<T> unique;
-  std::vector<size_t> indices;
-  size_t count = 0;
-  const typename Range::const_iterator end = r.end();
-  for (typename Range::const_iterator it = r.begin(); it != end;
-       ++it, ++count) {
-    const typename std::unordered_set<T>::iterator occur = unique.find(*it);
-    if (occur == unique.end()) {
-      unique.insert(*it);
-    } else {
-      indices.push_back(count);
+  using Value = typename std::iterator_traits<ForwardIterator>::value_type;
+  using Hash = struct
+  {
+    std::size_t operator()(ForwardIterator it) const
+    {
+      return std::hash<Value>{}(*it);
     }
+  };
+
+  using Equal = struct
+  {
+    bool operator()(ForwardIterator it1, ForwardIterator it2) const
+    {
+      return *it1 == *it2;
+    }
+  };
+  std::unordered_set<ForwardIterator, Hash, Equal> uniq;
+
+  ForwardIterator result = first;
+  while (first != last) {
+    if (uniq.find(first) == uniq.end()) {
+      if (result != first) {
+        *result = std::move(*first);
+      }
+      uniq.insert(result);
+      ++result;
+    }
+    ++first;
   }
-  if (indices.empty()) {
-    return end;
-  }
-  return cmRemoveIndices(r, indices);
+  return result;
+}
+
+template <typename Range>
+typename Range::const_iterator cmRemoveDuplicates(Range& r)
+{
+  return cmRemoveDuplicates(r.begin(), r.end());
 }
 
 template <typename Range>

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d53317130e84898c5328c237186dbd995aaf1c12
commit d53317130e84898c5328c237186dbd995aaf1c12
Author:     JerryShih <bignose1007 at gmail.com>
AuthorDate: Thu Feb 28 16:30:43 2019 +0800
Commit:     JerryShih <bignose1007 at gmail.com>
CommitDate: Wed Mar 6 11:16:32 2019 +0800

    FindThreads: Use complete program to test for pthreads in libc
    
    Our check for just `pthread_create` is not sufficient because there are
    cases where that symbol may be found in libc but not all of pthreads.
    We first tried to address this in commit e9a1ddc594 (FindThreads:
    Replace the pthread symbol checking in libc., 2018-11-18,
    v3.14.0-rc1~292^2) by switching to `pthread_kill`, but that had to be
    reverted by commit 18320230ec (FindThreads: Revert libc symbol check to
    pthread_create, 2019-02-27, v3.14.0-rc3~6^2) because there are other
    cases where `pthread_kill` is in libc but the rest of pthreads is not.
    Update our check to try a complete program using pthreads as an actual
    application might.
    
    Fixes: #18994

diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 919392a..3684f01 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -38,19 +38,42 @@ This module is not needed for C++11 and later if threading is done using
 #]=======================================================================]
 
 include (CheckLibraryExists)
-include (CheckSymbolExists)
 set(Threads_FOUND FALSE)
 set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
 set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY})
 
 if(CMAKE_C_COMPILER_LOADED)
   include (CheckIncludeFile)
+  include (CheckCSourceCompiles)
 elseif(CMAKE_CXX_COMPILER_LOADED)
   include (CheckIncludeFileCXX)
+  include (CheckCXXSourceCompiles)
 else()
   message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled")
 endif()
 
+# simple pthread test code
+set(PTHREAD_C_CXX_TEST_SOURCE [====[
+#include <pthread.h>
+
+void* test_func(void* data)
+{
+  return data;
+}
+
+int main(void)
+{
+  pthread_t thread;
+  pthread_create(&thread, NULL, test_func, NULL);
+  pthread_detach(thread);
+  pthread_join(thread, NULL);
+  pthread_atfork(NULL, NULL, NULL);
+  pthread_exit(NULL);
+
+  return 0;
+}
+]====])
+
 # Internal helper macro.
 # Do NOT even think about using it outside of this file!
 macro(_check_threads_lib LIBNAME FUNCNAME VARNAME)
@@ -109,8 +132,8 @@ if(CMAKE_C_COMPILER_LOADED)
 else()
   CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
 endif()
-if(CMAKE_HAVE_PTHREAD_H)
 
+if(CMAKE_HAVE_PTHREAD_H)
   #
   # We have pthread.h
   # Let's check for the library now.
@@ -118,13 +141,19 @@ if(CMAKE_HAVE_PTHREAD_H)
   set(CMAKE_HAVE_THREADS_LIBRARY)
   if(NOT THREADS_HAVE_PTHREAD_ARG)
     # Check if pthread functions are in normal C library.
-    CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
-    if(CMAKE_HAVE_LIBC_CREATE)
+    # We list some pthread functions in PTHREAD_C_CXX_TEST_SOURCE test code.
+    # If the pthread functions already exist in C library, we could just use
+    # them instead of linking to the additional pthread library.
+    if(CMAKE_C_COMPILER_LOADED)
+      CHECK_C_SOURCE_COMPILES("${PTHREAD_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_PTHREAD)
+    elseif(CMAKE_CXX_COMPILER_LOADED)
+      CHECK_CXX_SOURCE_COMPILES("${PTHREAD_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_PTHREAD)
+    endif()
+    if(CMAKE_HAVE_LIBC_PTHREAD)
       set(CMAKE_THREAD_LIBS_INIT "")
       set(CMAKE_HAVE_THREADS_LIBRARY 1)
       set(Threads_FOUND TRUE)
     else()
-
       # Check for -pthread first if enabled. This is the recommended
       # way, but not backwards compatible as one must also pass -pthread
       # as compiler flag then.
@@ -144,7 +173,7 @@ if(CMAKE_HAVE_PTHREAD_H)
   _check_pthreads_flag()
 endif()
 
-if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
+if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD)
   set(CMAKE_USE_PTHREADS_INIT 1)
   set(Threads_FOUND TRUE)
 endif()

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

Summary of changes:
 Help/command/add_test.rst             |   3 +-
 Help/command/enable_testing.rst       |  15 ++-
 Modules/FindThreads.cmake             |  41 +++++-
 Source/cmAlgorithms.h                 |  54 +++++---
 Source/cmGeneratorTarget.cxx          | 226 ++++++++++++++++++++++++----------
 Utilities/Release/win32_release.cmake |  10 +-
 Utilities/Release/win64_release.cmake |  10 +-
 7 files changed, 257 insertions(+), 102 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list