[Cmake-commits] CMake branch, next, updated. v3.3.0-2093-g010f4f8

Stephen Kelly steveire at gmail.com
Fri Aug 7 11:06:32 EDT 2015


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  010f4f8c6a8e6d45d7f49aa083d12f65de714557 (commit)
       via  03dd19a3eef57d6edfff017dae4aba0a62d9f165 (commit)
       via  3bbd5425d31e179dbb1b70d944ac24523b0eb46b (commit)
       via  197f4de110a59332757360110b1e90f6b07e1c97 (commit)
       via  44e071aeff4d533f116a7721919f9036c5d5a1d1 (commit)
       via  772ecef4b8037d5ce59d24772c05829872aff406 (commit)
       via  1f54bc1cf35707a5f1410ff4c6632d7cba351c40 (commit)
       via  7568199b4de18ed56ad8ef735c145c4a44327355 (commit)
      from  ffdce7ed84af2fd2e4e189789ea83a70785f03ad (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=010f4f8c6a8e6d45d7f49aa083d12f65de714557
commit 010f4f8c6a8e6d45d7f49aa083d12f65de714557
Merge: ffdce7e 03dd19a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Aug 7 11:06:31 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Aug 7 11:06:31 2015 -0400

    Merge topic 'use-generator-target' into next
    
    03dd19a3 cmTarget: Use a simpler delete algorithm.
    3bbd5425 cmTarget: Split storage of sources from genexes.
    197f4de1 cmTarget: Split storage of compile definitions from genexes.
    44e071ae cmTarget: Split storage of compile features from genexes.
    772ecef4 cmTarget: Split storage of compile options from genexes.
    1f54bc1c cmTarget: Split storage of include directories from genexes.
    7568199b cmTarget: Request only the link libraries where needed.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03dd19a3eef57d6edfff017dae4aba0a62d9f165
commit 03dd19a3eef57d6edfff017dae4aba0a62d9f165
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 23:16:12 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:20 2015 +0200

    cmTarget: Use a simpler delete algorithm.
    
    This way, the methods can be moved without requiring a local algorithm.
    
    The containers use automatic storage.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d30f2f5..f1a05ff 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -193,14 +193,6 @@ public:
 cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem;
 
 //----------------------------------------------------------------------------
-static void deleteAndClear(
-      std::vector<cmTargetInternals::TargetPropertyEntry*> &entries)
-{
-  cmDeleteAll(entries);
-  entries.clear();
-}
-
-//----------------------------------------------------------------------------
 cmTargetInternals::~cmTargetInternals()
 {
 }
@@ -817,7 +809,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
     this->LinkImplementationLanguageIsContextDependent = false;
     }
 
-  deleteAndClear(linkInterfaceSourcesEntries);
+  cmDeleteAll(linkInterfaceSourcesEntries);
 }
 
 //----------------------------------------------------------------------------
@@ -2172,7 +2164,7 @@ cmTarget::GetIncludeDirectories(const std::string& config,
                             debugIncludes,
                             language);
 
-  deleteAndClear(linkInterfaceIncludeDirectoriesEntries);
+  cmDeleteAll(linkInterfaceIncludeDirectoriesEntries);
 
   return includes;
 }
@@ -2293,7 +2285,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
                             debugOptions,
                             language);
 
-  deleteAndClear(linkInterfaceCompileOptionsEntries);
+  cmDeleteAll(linkInterfaceCompileOptionsEntries);
 }
 
 //----------------------------------------------------------------------------
@@ -2395,7 +2387,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
                             debugDefines,
                             language);
 
-  deleteAndClear(linkInterfaceCompileDefinitionsEntries);
+  cmDeleteAll(linkInterfaceCompileDefinitionsEntries);
 }
 
 //----------------------------------------------------------------------------
@@ -2462,7 +2454,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
                             config,
                             debugFeatures);
 
-  deleteAndClear(linkInterfaceCompileFeaturesEntries);
+  cmDeleteAll(linkInterfaceCompileFeaturesEntries);
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bbd5425d31e179dbb1b70d944ac24523b0eb46b
commit 3bbd5425d31e179dbb1b70d944ac24523b0eb46b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 21:46:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:19 2015 +0200

    cmTarget: Split storage of sources from genexes.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index ce806ba..b094125 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -313,7 +313,9 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
     makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
                             mocCppFile.c_str(), false);
 
-    target->AddSource(mocCppFile);
+    std::vector<std::string> mocCppFiles;
+    mocCppFiles.push_back(mocCppFile);
+    target->AddTracedSources(mocCppFiles);
     }
   // create a custom target for running generators at buildtime:
   std::string autogenTargetName = getAutogenTargetName(target);
@@ -737,12 +739,7 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
       }
     }
 
-  for(std::vector<std::string>::const_iterator fileIt = newRccFiles.begin();
-      fileIt != newRccFiles.end();
-      ++fileIt)
-    {
-    const_cast<cmTarget*>(target)->AddSource(*fileIt);
-    }
+  const_cast<cmTarget*>(target)->AddTracedSources(newRccFiles);
 }
 
 void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1277fc2..d30f2f5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -180,7 +180,9 @@ public:
   std::vector<std::string> CompileDefinitionsEntries;
   std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
   std::vector<TargetPropertyEntry*> CompileDefinitionsItems;
-  std::vector<TargetPropertyEntry*> SourceEntries;
+  std::vector<std::string> SourceEntries;
+  std::vector<cmListFileBacktrace> SourceBacktraces;
+  std::vector<TargetPropertyEntry*> SourceItems;
   std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
 
   void AddInterfaceEntries(
@@ -448,7 +450,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
 void CreatePropertyGeneratorExpressions(
     std::vector<std::string> const& entries,
     std::vector<cmListFileBacktrace> const& backtraces,
-    std::vector<cmTargetInternals::TargetPropertyEntry*>& items)
+    std::vector<cmTargetInternals::TargetPropertyEntry*>& items,
+    bool evaluateForBuildsystem = false)
 {
   std::vector<cmListFileBacktrace>::const_iterator btIt = backtraces.begin();
   for (std::vector<std::string>::const_iterator it = entries.begin();
@@ -456,6 +459,7 @@ void CreatePropertyGeneratorExpressions(
     {
     cmGeneratorExpression ge(*btIt);
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
+    cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
     items.push_back(new cmTargetInternals::TargetPropertyEntry(cge));
     }
 }
@@ -481,6 +485,11 @@ void cmTarget::Compute()
         this->Internal->CompileDefinitionsEntries,
         this->Internal->CompileDefinitionsBacktraces,
         this->Internal->CompileDefinitionsItems);
+
+  CreatePropertyGeneratorExpressions(
+        this->Internal->SourceEntries,
+        this->Internal->SourceBacktraces,
+        this->Internal->SourceItems, true);
 }
 
 //----------------------------------------------------------------------------
@@ -733,13 +742,11 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
     // for TARGET_OBJECTS instead for backwards compatibility with OLD
     // behavior of CMP0024 and CMP0026 only.
 
-    typedef cmTargetInternals::TargetPropertyEntry
-                                TargetPropertyEntry;
-    for(std::vector<TargetPropertyEntry*>::const_iterator
+    for(std::vector<std::string>::const_iterator
           i = this->Internal->SourceEntries.begin();
         i != this->Internal->SourceEntries.end(); ++i)
       {
-      std::string entry = (*i)->ge->GetInput();
+      std::string const& entry = *i;
 
       std::vector<std::string> items;
       cmSystemTools::ExpandListArgument(entry, items);
@@ -781,7 +788,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
 
   UNORDERED_SET<std::string> uniqueSrcs;
   bool contextDependentDirectSources = processSources(this,
-                 this->Internal->SourceEntries,
+                 this->Internal->SourceItems,
                  files,
                  uniqueSrcs,
                  &dagChecker,
@@ -918,11 +925,12 @@ void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
     this->Internal->SourceFilesMap.clear();
     this->LinkImplementationLanguageIsContextDependent = true;
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+    this->Internal->SourceEntries.push_back(srcFiles);
+    this->Internal->SourceBacktraces.push_back(lfbt);
     cmGeneratorExpression ge(lfbt);
     cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
-    cge->SetEvaluateForBuildsystem(true);
-    this->Internal->SourceEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->SourceItems.push_back(
+          new cmTargetInternals::TargetPropertyEntry(cge));
     }
 }
 
@@ -958,11 +966,8 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
     this->Internal->SourceFilesMap.clear();
     this->LinkImplementationLanguageIsContextDependent = true;
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
-    cge->SetEvaluateForBuildsystem(true);
-    this->Internal->SourceEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->SourceEntries.push_back(srcFiles);
+    this->Internal->SourceBacktraces.push_back(lfbt);
     }
 }
 
@@ -1066,10 +1071,10 @@ public:
 
   }
 
-  bool operator()(cmTargetInternals::TargetPropertyEntry* entry)
+  bool operator()(std::string const& entry)
   {
     std::vector<std::string> files;
-    cmSystemTools::ExpandListArgument(entry->ge->GetInput(), files);
+    cmSystemTools::ExpandListArgument(entry, files);
     std::vector<cmSourceFileLocation> locations(files.size());
     std::transform(files.begin(), files.end(), locations.begin(),
                    CreateLocation(this->Needle.GetMakefile()));
@@ -1091,11 +1096,8 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
     this->Internal->SourceFilesMap.clear();
     this->LinkImplementationLanguageIsContextDependent = true;
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
-    cge->SetEvaluateForBuildsystem(true);
-    this->Internal->SourceEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->SourceEntries.push_back(src);
+    this->Internal->SourceBacktraces.push_back(lfbt);
     }
   if (cmGeneratorExpression::Find(src) != std::string::npos)
     {
@@ -1770,11 +1772,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
       }
     this->Internal->SourceFilesMap.clear();
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
+
     this->Internal->SourceEntries.clear();
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-    this->Internal->SourceEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->SourceBacktraces.clear();
+    this->Internal->SourceEntries.push_back(value);
+    this->Internal->SourceBacktraces.push_back(lfbt);
     }
   else
     {
@@ -1855,10 +1857,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
       }
       this->Internal->SourceFilesMap.clear();
       cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-      cmGeneratorExpression ge(lfbt);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-      this->Internal->SourceEntries.push_back(
-                            new cmTargetInternals::TargetPropertyEntry(cge));
+      this->Internal->SourceEntries.push_back(value);
+      this->Internal->SourceBacktraces.push_back(lfbt);
     }
   else
     {
@@ -2983,13 +2983,11 @@ const char *cmTarget::GetProperty(const std::string& prop,
 
       std::ostringstream ss;
       const char* sep = "";
-      typedef cmTargetInternals::TargetPropertyEntry
-                                  TargetPropertyEntry;
-      for(std::vector<TargetPropertyEntry*>::const_iterator
+      for(std::vector<std::string>::const_iterator
             i = this->Internal->SourceEntries.begin();
           i != this->Internal->SourceEntries.end(); ++i)
         {
-        std::string entry = (*i)->ge->GetInput();
+        std::string const& entry = *i;
 
         std::vector<std::string> files;
         cmSystemTools::ExpandListArgument(entry, files);
@@ -3689,13 +3687,11 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
   // there is no cmGeneratorTarget at configure-time, so search the SOURCES
   // for TARGET_OBJECTS instead for backwards compatibility with OLD
   // behavior of CMP0024 and CMP0026 only.
-  typedef cmTargetInternals::TargetPropertyEntry
-                              TargetPropertyEntry;
-  for(std::vector<TargetPropertyEntry*>::const_iterator
+  for(std::vector<std::string>::const_iterator
         i = this->Internal->SourceEntries.begin();
       i != this->Internal->SourceEntries.end(); ++i)
     {
-    std::string entry = (*i)->ge->GetInput();
+    std::string const& entry = *i;
 
     std::vector<std::string> files;
     cmSystemTools::ExpandListArgument(entry, files);
@@ -4832,7 +4828,7 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
   cmDeleteAll(this->Pointer->CompileOptionsItems);
   cmDeleteAll(this->Pointer->CompileFeaturesItems);
   cmDeleteAll(this->Pointer->CompileDefinitionsItems);
-  cmDeleteAll(this->Pointer->SourceEntries);
+  cmDeleteAll(this->Pointer->SourceItems);
   delete this->Pointer;
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=197f4de110a59332757360110b1e90f6b07e1c97
commit 197f4de110a59332757360110b1e90f6b07e1c97
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 21:30:17 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:19 2015 +0200

    cmTarget: Split storage of compile definitions from genexes.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index cc1df84..1277fc2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -177,7 +177,9 @@ public:
   std::vector<std::string> CompileFeaturesEntries;
   std::vector<cmListFileBacktrace> CompileFeaturesBacktraces;
   std::vector<TargetPropertyEntry*> CompileFeaturesItems;
-  std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
+  std::vector<std::string> CompileDefinitionsEntries;
+  std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces;
+  std::vector<TargetPropertyEntry*> CompileDefinitionsItems;
   std::vector<TargetPropertyEntry*> SourceEntries;
   std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
 
@@ -474,6 +476,11 @@ void cmTarget::Compute()
         this->Internal->CompileFeaturesEntries,
         this->Internal->CompileFeaturesBacktraces,
         this->Internal->CompileFeaturesItems);
+
+  CreatePropertyGeneratorExpressions(
+        this->Internal->CompileDefinitionsEntries,
+        this->Internal->CompileDefinitionsBacktraces,
+        this->Internal->CompileDefinitionsItems);
 }
 
 //----------------------------------------------------------------------------
@@ -1728,12 +1735,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     }
   else if(prop == "COMPILE_DEFINITIONS")
     {
+    this->Internal->CompileDefinitionsEntries.clear();
+    this->Internal->CompileDefinitionsBacktraces.clear();
+    this->Internal->CompileDefinitionsEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    deleteAndClear(this->Internal->CompileDefinitionsEntries);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-    this->Internal->CompileDefinitionsEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
     }
   else if(prop == "EXPORT_NAME" && this->IsImported())
     {
@@ -1817,10 +1823,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     }
   else if(prop == "COMPILE_DEFINITIONS")
     {
+    this->Internal->CompileDefinitionsEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    this->Internal->CompileDefinitionsEntries.push_back(
-              new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+    this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
     }
   else if(prop == "EXPORT_NAME" && this->IsImported())
     {
@@ -1952,10 +1957,8 @@ void cmTarget::InsertCompileOption(std::string const& entry,
 void cmTarget::InsertCompileDefinition(std::string const& entry,
                                        cmListFileBacktrace const& bt)
 {
-  cmGeneratorExpression ge(bt);
-
-  this->Internal->CompileDefinitionsEntries.push_back(
-      new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
+  this->Internal->CompileDefinitionsEntries.push_back(entry);
+  this->Internal->CompileDefinitionsBacktraces.push_back(bt);
 }
 
 //----------------------------------------------------------------------------
@@ -2337,7 +2340,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
     }
 
   processCompileDefinitions(this,
-                            this->Internal->CompileDefinitionsEntries,
+                            this->Internal->CompileDefinitionsItems,
                             list,
                             uniqueOptions,
                             &dagChecker,
@@ -2745,22 +2748,6 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 }
 
 //----------------------------------------------------------------------------
-static void MakePropertyList(std::string& output,
-    std::vector<cmTargetInternals::TargetPropertyEntry*> const& values)
-{
-  output = "";
-  std::string sep;
-  for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
-       it = values.begin(), end = values.end();
-       it != end; ++it)
-    {
-    output += sep;
-    output += (*it)->ge->GetInput();
-    sep = ";";
-    }
-}
-
-//----------------------------------------------------------------------------
 const char *cmTarget::GetProperty(const std::string& prop) const
 {
   return this->GetProperty(prop, this->Makefile);
@@ -2968,7 +2955,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
+      output = cmJoin(this->Internal->CompileDefinitionsEntries, ";");
       return output.c_str();
       }
     else if (prop == propIMPORTED)
@@ -4844,7 +4831,7 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
   cmDeleteAll(this->Pointer->IncludeDirectoriesItems);
   cmDeleteAll(this->Pointer->CompileOptionsItems);
   cmDeleteAll(this->Pointer->CompileFeaturesItems);
-  cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
+  cmDeleteAll(this->Pointer->CompileDefinitionsItems);
   cmDeleteAll(this->Pointer->SourceEntries);
   delete this->Pointer;
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44e071aeff4d533f116a7721919f9036c5d5a1d1
commit 44e071aeff4d533f116a7721919f9036c5d5a1d1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 21:23:38 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:18 2015 +0200

    cmTarget: Split storage of compile features from genexes.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 09806e2..cc1df84 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -174,7 +174,9 @@ public:
   std::vector<std::string> CompileOptionsEntries;
   std::vector<cmListFileBacktrace> CompileOptionsBacktraces;
   std::vector<TargetPropertyEntry*> CompileOptionsItems;
-  std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
+  std::vector<std::string> CompileFeaturesEntries;
+  std::vector<cmListFileBacktrace> CompileFeaturesBacktraces;
+  std::vector<TargetPropertyEntry*> CompileFeaturesItems;
   std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
   std::vector<TargetPropertyEntry*> SourceEntries;
   std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
@@ -467,6 +469,11 @@ void cmTarget::Compute()
         this->Internal->CompileOptionsEntries,
         this->Internal->CompileOptionsBacktraces,
         this->Internal->CompileOptionsItems);
+
+  CreatePropertyGeneratorExpressions(
+        this->Internal->CompileFeaturesEntries,
+        this->Internal->CompileFeaturesBacktraces,
+        this->Internal->CompileFeaturesItems);
 }
 
 //----------------------------------------------------------------------------
@@ -1713,12 +1720,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     }
   else if(prop == "COMPILE_FEATURES")
     {
+    this->Internal->CompileFeaturesEntries.clear();
+    this->Internal->CompileFeaturesBacktraces.clear();
+    this->Internal->CompileFeaturesEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    deleteAndClear(this->Internal->CompileFeaturesEntries);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-    this->Internal->CompileFeaturesEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_DEFINITIONS")
     {
@@ -1805,10 +1811,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     }
   else if(prop == "COMPILE_FEATURES")
     {
+    this->Internal->CompileFeaturesEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    this->Internal->CompileFeaturesEntries.push_back(
-              new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+    this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_DEFINITIONS")
     {
@@ -2433,7 +2438,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
     }
 
   processCompileFeatures(this,
-                            this->Internal->CompileFeaturesEntries,
+                            this->Internal->CompileFeaturesItems,
                             result,
                             uniqueFeatures,
                             &dagChecker,
@@ -2941,7 +2946,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->CompileFeaturesEntries);
+      output = cmJoin(this->Internal->CompileFeaturesEntries, ";");
       return output.c_str();
       }
     else if(prop == propCOMPILE_OPTIONS)
@@ -4838,7 +4843,7 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
 {
   cmDeleteAll(this->Pointer->IncludeDirectoriesItems);
   cmDeleteAll(this->Pointer->CompileOptionsItems);
-  cmDeleteAll(this->Pointer->CompileFeaturesEntries);
+  cmDeleteAll(this->Pointer->CompileFeaturesItems);
   cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
   cmDeleteAll(this->Pointer->SourceEntries);
   delete this->Pointer;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=772ecef4b8037d5ce59d24772c05829872aff406
commit 772ecef4b8037d5ce59d24772c05829872aff406
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 21:19:00 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:17 2015 +0200

    cmTarget: Split storage of compile options from genexes.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1eb8e6a..09806e2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -171,7 +171,9 @@ public:
   std::vector<std::string> IncludeDirectoriesEntries;
   std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
   std::vector<TargetPropertyEntry*> IncludeDirectoriesItems;
-  std::vector<TargetPropertyEntry*> CompileOptionsEntries;
+  std::vector<std::string> CompileOptionsEntries;
+  std::vector<cmListFileBacktrace> CompileOptionsBacktraces;
+  std::vector<TargetPropertyEntry*> CompileOptionsItems;
   std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
   std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
   std::vector<TargetPropertyEntry*> SourceEntries;
@@ -386,13 +388,12 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     const cmBacktraceRange parentOptionsBts =
                                 this->Makefile->GetCompileOptionsBacktraces();
 
-    cmBacktraceRange::const_iterator btIt = parentOptionsBts.begin();
-    for (cmStringRange::const_iterator it
-                = parentOptions.begin();
-         it != parentOptions.end(); ++it, ++btIt)
-      {
-      this->InsertCompileOption(*it, *btIt);
-      }
+    this->Internal->CompileOptionsEntries.insert(
+          this->Internal->CompileOptionsEntries.end(),
+          parentOptions.begin(), parentOptions.end());
+    this->Internal->CompileOptionsBacktraces.insert(
+          this->Internal->CompileOptionsBacktraces.end(),
+          parentOptionsBts.begin(), parentOptionsBts.end());
     }
 
   if (this->GetType() != INTERFACE_LIBRARY && this->GetType() != UTILITY)
@@ -461,6 +462,11 @@ void cmTarget::Compute()
         this->Internal->IncludeDirectoriesEntries,
         this->Internal->IncludeDirectoriesBacktraces,
         this->Internal->IncludeDirectoriesItems);
+
+  CreatePropertyGeneratorExpressions(
+        this->Internal->CompileOptionsEntries,
+        this->Internal->CompileOptionsBacktraces,
+        this->Internal->CompileOptionsItems);
 }
 
 //----------------------------------------------------------------------------
@@ -1699,12 +1705,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     }
   else if(prop == "COMPILE_OPTIONS")
     {
+    this->Internal->CompileOptionsEntries.clear();
+    this->Internal->CompileOptionsBacktraces.clear();
+    this->Internal->CompileOptionsEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    deleteAndClear(this->Internal->CompileOptionsEntries);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-    this->Internal->CompileOptionsEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->CompileOptionsBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_FEATURES")
     {
@@ -1794,10 +1799,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     }
   else if(prop == "COMPILE_OPTIONS")
     {
+    this->Internal->CompileOptionsEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    this->Internal->CompileOptionsEntries.push_back(
-              new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+    this->Internal->CompileOptionsBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_FEATURES")
     {
@@ -1927,14 +1931,16 @@ void cmTarget::InsertCompileOption(std::string const& entry,
                                    cmListFileBacktrace const& bt,
                                    bool before)
 {
-  cmGeneratorExpression ge(bt);
+  std::vector<std::string>::iterator position =
+      before ? this->Internal->CompileOptionsEntries.begin()
+             : this->Internal->CompileOptionsEntries.end();
 
-  std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
-                = before ? this->Internal->CompileOptionsEntries.begin()
-                         : this->Internal->CompileOptionsEntries.end();
+  std::vector<cmListFileBacktrace>::iterator btPosition =
+      before ? this->Internal->CompileOptionsBacktraces.begin()
+             : this->Internal->CompileOptionsBacktraces.end();
 
-  this->Internal->CompileOptionsEntries.insert(position,
-      new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
+  this->Internal->CompileOptionsEntries.insert(position, entry);
+  this->Internal->CompileOptionsBacktraces.insert(btPosition, bt);
 }
 
 //----------------------------------------------------------------------------
@@ -2255,7 +2261,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
     }
 
   processCompileOptions(this,
-                            this->Internal->CompileOptionsEntries,
+                            this->Internal->CompileOptionsItems,
                             result,
                             uniqueOptions,
                             &dagChecker,
@@ -2946,7 +2952,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->CompileOptionsEntries);
+      output = cmJoin(this->Internal->CompileOptionsEntries, ";");
       return output.c_str();
       }
     else if(prop == propCOMPILE_DEFINITIONS)
@@ -4831,7 +4837,7 @@ cmTargetInternalPointer
 cmTargetInternalPointer::~cmTargetInternalPointer()
 {
   cmDeleteAll(this->Pointer->IncludeDirectoriesItems);
-  cmDeleteAll(this->Pointer->CompileOptionsEntries);
+  cmDeleteAll(this->Pointer->CompileOptionsItems);
   cmDeleteAll(this->Pointer->CompileFeaturesEntries);
   cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
   cmDeleteAll(this->Pointer->SourceEntries);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f54bc1cf35707a5f1410ff4c6632d7cba351c40
commit 1f54bc1cf35707a5f1410ff4c6632d7cba351c40
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 20:25:02 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:15 2015 +0200

    cmTarget: Split storage of include directories from genexes.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3c818ff..50e2cd9 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1549,6 +1549,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
         ti != targets.end(); ++ti)
       {
       cmTarget* t = &ti->second;
+      t->Compute();
       cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
       this->GeneratorTargets[t] = gt;
       generatorTargets[t] = gt;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index d5a5585..51dcab0 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -254,6 +254,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
     mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false,
                           no_working_directory, no_depends,
                           noCommandLines);
+  tgt->Compute();
   cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
   mf->AddGeneratorTarget(tgt, gt);
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2f9d79a..b69fc65 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -90,6 +90,7 @@ bool cmGlobalVisualStudioGenerator::Compute()
         AddUtilityCommand("ALL_BUILD", true, no_working_dir,
                           no_depends, no_commands, false,
                           "Build all projects");
+      allBuild->Compute();
       cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
       allBuild->GetMakefile()->AddGeneratorTarget(allBuild, gt);
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5006828..39933cb 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -463,6 +463,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   cmTarget* allbuild = mf->AddUtilityCommand("ALL_BUILD", true, no_depends,
                         no_working_directory,
                         "echo", "Build all projects");
+  allbuild->Compute();
   cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
   mf->AddGeneratorTarget(allbuild, allBuildGt);
 
@@ -497,6 +498,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
                           true, no_depends,
                           no_working_directory,
                           "make", "-f", file.c_str());
+    check->Compute();
     cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
     mf->AddGeneratorTarget(check, checkGt);
     }
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index f1ba2f4..ce806ba 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -475,6 +475,8 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
                                 /*byproducts=*/rcc_output, depends,
                                 commandLines, false, autogenComment.c_str());
 
+    autogenTarget->Compute();
+
     cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
     makefile->AddGeneratorTarget(autogenTarget, gt);
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7b25819..1eb8e6a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -168,7 +168,9 @@ public:
     const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
     cmLinkImplItem const& LinkImplItem;
   };
-  std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
+  std::vector<std::string> IncludeDirectoriesEntries;
+  std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
+  std::vector<TargetPropertyEntry*> IncludeDirectoriesItems;
   std::vector<TargetPropertyEntry*> CompileOptionsEntries;
   std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
   std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
@@ -366,13 +368,13 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     const cmBacktraceRange parentIncludesBts =
         this->Makefile->GetIncludeDirectoriesBacktraces();
 
-    cmBacktraceRange::const_iterator btIt = parentIncludesBts.begin();
-    for (cmStringRange::const_iterator it
-                = parentIncludes.begin();
-         it != parentIncludes.end(); ++it, ++btIt)
-      {
-      this->InsertInclude(*it, *btIt);
-      }
+    this->Internal->IncludeDirectoriesEntries.insert(
+          this->Internal->IncludeDirectoriesEntries.end(),
+          parentIncludes.begin(), parentIncludes.end());
+    this->Internal->IncludeDirectoriesBacktraces.insert(
+          this->Internal->IncludeDirectoriesBacktraces.end(),
+          parentIncludesBts.begin(), parentIncludesBts.end());
+
     const std::set<std::string> parentSystemIncludes =
                                 this->Makefile->GetSystemIncludeDirectories();
 
@@ -384,7 +386,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     const cmBacktraceRange parentOptionsBts =
                                 this->Makefile->GetCompileOptionsBacktraces();
 
-    btIt = parentOptionsBts.begin();
+    cmBacktraceRange::const_iterator btIt = parentOptionsBts.begin();
     for (cmStringRange::const_iterator it
                 = parentOptions.begin();
          it != parentOptions.end(); ++it, ++btIt)
@@ -438,6 +440,29 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     }
 }
 
+void CreatePropertyGeneratorExpressions(
+    std::vector<std::string> const& entries,
+    std::vector<cmListFileBacktrace> const& backtraces,
+    std::vector<cmTargetInternals::TargetPropertyEntry*>& items)
+{
+  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);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
+    items.push_back(new cmTargetInternals::TargetPropertyEntry(cge));
+    }
+}
+
+void cmTarget::Compute()
+{
+  CreatePropertyGeneratorExpressions(
+        this->Internal->IncludeDirectoriesEntries,
+        this->Internal->IncludeDirectoriesBacktraces,
+        this->Internal->IncludeDirectoriesItems);
+}
+
 //----------------------------------------------------------------------------
 void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
 {
@@ -1666,12 +1691,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
     }
   else if(prop == "INCLUDE_DIRECTORIES")
     {
+    this->Internal->IncludeDirectoriesEntries.clear();
+    this->Internal->IncludeDirectoriesBacktraces.clear();
+    this->Internal->IncludeDirectoriesEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    deleteAndClear(this->Internal->IncludeDirectoriesEntries);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
-    this->Internal->IncludeDirectoriesEntries.push_back(
-                          new cmTargetInternals::TargetPropertyEntry(cge));
+    this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_OPTIONS")
     {
@@ -1764,10 +1788,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
     }
   else if(prop == "INCLUDE_DIRECTORIES")
     {
+    this->Internal->IncludeDirectoriesEntries.push_back(value);
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
-    cmGeneratorExpression ge(lfbt);
-    this->Internal->IncludeDirectoriesEntries.push_back(
-              new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+    this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
     }
   else if(prop == "COMPILE_OPTIONS")
     {
@@ -1887,14 +1910,16 @@ void cmTarget::InsertInclude(std::string const& entry,
                              cmListFileBacktrace const& bt,
                              bool before)
 {
-  cmGeneratorExpression ge(bt);
+  std::vector<std::string>::iterator position =
+      before ? this->Internal->IncludeDirectoriesEntries.begin()
+             : this->Internal->IncludeDirectoriesEntries.end();
 
-  std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
-                = before ? this->Internal->IncludeDirectoriesEntries.begin()
-                         : this->Internal->IncludeDirectoriesEntries.end();
+  std::vector<cmListFileBacktrace>::iterator btPosition =
+      before ? this->Internal->IncludeDirectoriesBacktraces.begin()
+             : this->Internal->IncludeDirectoriesBacktraces.end();
 
-  this->Internal->IncludeDirectoriesEntries.insert(position,
-      new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry)));
+  this->Internal->IncludeDirectoriesEntries.insert(position, entry);
+  this->Internal->IncludeDirectoriesBacktraces.insert(btPosition, bt);
 }
 
 //----------------------------------------------------------------------------
@@ -2083,7 +2108,7 @@ cmTarget::GetIncludeDirectories(const std::string& config,
     }
 
   processIncludeDirectories(this,
-                            this->Internal->IncludeDirectoriesEntries,
+                            this->Internal->IncludeDirectoriesItems,
                             includes,
                             uniqueIncludes,
                             &dagChecker,
@@ -2899,7 +2924,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
         }
 
       static std::string output;
-      MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
+      output = cmJoin(this->Internal->IncludeDirectoriesEntries, ";");
       return output.c_str();
       }
     else if(prop == propCOMPILE_FEATURES)
@@ -4805,7 +4830,7 @@ cmTargetInternalPointer
 //----------------------------------------------------------------------------
 cmTargetInternalPointer::~cmTargetInternalPointer()
 {
-  cmDeleteAll(this->Pointer->IncludeDirectoriesEntries);
+  cmDeleteAll(this->Pointer->IncludeDirectoriesItems);
   cmDeleteAll(this->Pointer->CompileOptionsEntries);
   cmDeleteAll(this->Pointer->CompileFeaturesEntries);
   cmDeleteAll(this->Pointer->CompileDefinitionsEntries);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c5918ba..490aaa3 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -132,6 +132,8 @@ public:
   void AddPostBuildCommand(cmCustomCommand const &cmd)
     {this->PostBuildCommands.push_back(cmd);}
 
+  void Compute();
+
   /**
    * Get the list of the source files used by this target
    */

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7568199b4de18ed56ad8ef735c145c4a44327355
commit 7568199b4de18ed56ad8ef735c145c4a44327355
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Aug 4 19:22:30 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Aug 7 17:06:15 2015 +0200

    cmTarget: Request only the link libraries where needed.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1d4313e..7b25819 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2099,7 +2099,8 @@ cmTarget::GetIncludeDirectories(const std::string& config,
 
   if(this->Makefile->IsOn("APPLE"))
     {
-    LinkImplementation const* impl = this->GetLinkImplementation(config);
+    cmLinkImplementationLibraries const* impl =
+        this->GetLinkImplementationLibraries(config);
     for(std::vector<cmLinkImplItem>::const_iterator
         it = impl->Libraries.begin();
         it != impl->Libraries.end(); ++it)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list