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 4237e9d3fde9f6fce5cb7fe8c85c21686d8708a5 (commit) via 047b83c77099879ad16da674930fce5d5df9ac4d (commit) via 8b501eeb2bba213580ca900f7ad6251e1c8b79e5 (commit) via ce14c83b5a4115531a6fce4f7523458371a562b3 (commit) via 1faf5abf53a36491e7c374f80b635278691f76e2 (commit) via 345897936dd1bdfb43fba555bffad7d8159c1eec (commit) via 3eeeec4015d83fc87f48042c3125c4ac76689537 (commit) from 7d31d99d990b2c64d65a6b82a5f8308024ebb057 (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=4237e9d3fde9f6fce5cb7fe8c85c21686d8708a5 commit 4237e9d3fde9f6fce5cb7fe8c85c21686d8708a5 Merge: 7d31d99 047b83c Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Aug 6 22:08:29 2015 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Aug 6 22:08:29 2015 -0400 Merge topic 'use-generator-target' into next 047b83c7 cmTarget: Use a simpler delete algorithm. 8b501eeb cmTarget: Split storage of sources from genexes. ce14c83b cmTarget: Split storage of compile definitions from genexes. 1faf5abf cmTarget: Split storage of compile features from genexes. 34589793 cmTarget: Split storage of compile options from genexes. 3eeeec40 cmTarget: Split storage of include directories from genexes. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=047b83c77099879ad16da674930fce5d5df9ac4d commit 047b83c77099879ad16da674930fce5d5df9ac4d Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 23:16:12 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08:19 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 54934c1..ef2df21 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -161,14 +161,6 @@ public: cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem; //---------------------------------------------------------------------------- -static void deleteAndClear( - std::vector<cmTargetInternals::TargetPropertyEntry*> &entries) -{ - cmDeleteAll(entries); - entries.clear(); -} - -//---------------------------------------------------------------------------- cmTargetInternals::~cmTargetInternals() { } @@ -783,7 +775,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, this->LinkImplementationLanguageIsContextDependent = false; } - deleteAndClear(linkInterfaceSourcesEntries); + cmDeleteAll(linkInterfaceSourcesEntries); } //---------------------------------------------------------------------------- @@ -2138,7 +2130,7 @@ cmTarget::GetIncludeDirectories(const std::string& config, debugIncludes, language); - deleteAndClear(linkInterfaceIncludeDirectoriesEntries); + cmDeleteAll(linkInterfaceIncludeDirectoriesEntries); return includes; } @@ -2259,7 +2251,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result, debugOptions, language); - deleteAndClear(linkInterfaceCompileOptionsEntries); + cmDeleteAll(linkInterfaceCompileOptionsEntries); } //---------------------------------------------------------------------------- @@ -2361,7 +2353,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, debugDefines, language); - deleteAndClear(linkInterfaceCompileDefinitionsEntries); + cmDeleteAll(linkInterfaceCompileDefinitionsEntries); } //---------------------------------------------------------------------------- @@ -2428,7 +2420,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=8b501eeb2bba213580ca900f7ad6251e1c8b79e5 commit 8b501eeb2bba213580ca900f7ad6251e1c8b79e5 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 21:46:15 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08: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 c14691c..54934c1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -148,7 +148,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( @@ -416,7 +418,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(); @@ -424,6 +427,7 @@ void CreatePropertyGeneratorExpressions( { cmGeneratorExpression ge(*btIt); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it); + cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); items.push_back(new cmTargetInternals::TargetPropertyEntry(cge)); } } @@ -449,6 +453,11 @@ void cmTarget::Compute() this->Internal->CompileDefinitionsEntries, this->Internal->CompileDefinitionsBacktraces, this->Internal->CompileDefinitionsItems); + + CreatePropertyGeneratorExpressions( + this->Internal->SourceEntries, + this->Internal->SourceBacktraces, + this->Internal->SourceItems, true); } //---------------------------------------------------------------------------- @@ -699,13 +708,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); @@ -747,7 +754,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, @@ -884,11 +891,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)); } } @@ -924,11 +932,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); } } @@ -1032,10 +1037,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())); @@ -1057,11 +1062,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) { @@ -1736,11 +1738,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 { @@ -1821,10 +1823,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 { @@ -2949,13 +2949,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); @@ -3610,13 +3608,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); @@ -4366,7 +4362,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=ce14c83b5a4115531a6fce4f7523458371a562b3 commit ce14c83b5a4115531a6fce4f7523458371a562b3 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 21:30:17 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08:19 2015 +0200 cmTarget: Split storage of compile definitions from genexes. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1762d2f..c14691c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -145,7 +145,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; @@ -442,6 +444,11 @@ void cmTarget::Compute() this->Internal->CompileFeaturesEntries, this->Internal->CompileFeaturesBacktraces, this->Internal->CompileFeaturesItems); + + CreatePropertyGeneratorExpressions( + this->Internal->CompileDefinitionsEntries, + this->Internal->CompileDefinitionsBacktraces, + this->Internal->CompileDefinitionsItems); } //---------------------------------------------------------------------------- @@ -1694,12 +1701,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()) { @@ -1783,10 +1789,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()) { @@ -1918,10 +1923,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); } //---------------------------------------------------------------------------- @@ -2303,7 +2306,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, } processCompileDefinitions(this, - this->Internal->CompileDefinitionsEntries, + this->Internal->CompileDefinitionsItems, list, uniqueOptions, &dagChecker, @@ -2711,22 +2714,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); @@ -2934,7 +2921,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) @@ -4378,7 +4365,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=1faf5abf53a36491e7c374f80b635278691f76e2 commit 1faf5abf53a36491e7c374f80b635278691f76e2 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 21:23:38 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08:19 2015 +0200 cmTarget: Split storage of compile features from genexes. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ae8fea2..1762d2f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -142,7 +142,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; @@ -435,6 +437,11 @@ void cmTarget::Compute() this->Internal->CompileOptionsEntries, this->Internal->CompileOptionsBacktraces, this->Internal->CompileOptionsItems); + + CreatePropertyGeneratorExpressions( + this->Internal->CompileFeaturesEntries, + this->Internal->CompileFeaturesBacktraces, + this->Internal->CompileFeaturesItems); } //---------------------------------------------------------------------------- @@ -1679,12 +1686,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") { @@ -1771,10 +1777,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") { @@ -2399,7 +2404,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result, } processCompileFeatures(this, - this->Internal->CompileFeaturesEntries, + this->Internal->CompileFeaturesItems, result, uniqueFeatures, &dagChecker, @@ -2907,7 +2912,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) @@ -4372,7 +4377,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=345897936dd1bdfb43fba555bffad7d8159c1eec commit 345897936dd1bdfb43fba555bffad7d8159c1eec Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 21:19:00 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08:19 2015 +0200 cmTarget: Split storage of compile options from genexes. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 23553c0..ae8fea2 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -139,7 +139,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; @@ -354,13 +356,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) @@ -429,6 +430,11 @@ void cmTarget::Compute() this->Internal->IncludeDirectoriesEntries, this->Internal->IncludeDirectoriesBacktraces, this->Internal->IncludeDirectoriesItems); + + CreatePropertyGeneratorExpressions( + this->Internal->CompileOptionsEntries, + this->Internal->CompileOptionsBacktraces, + this->Internal->CompileOptionsItems); } //---------------------------------------------------------------------------- @@ -1665,12 +1671,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") { @@ -1760,10 +1765,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") { @@ -1893,14 +1897,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); } //---------------------------------------------------------------------------- @@ -2221,7 +2227,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result, } processCompileOptions(this, - this->Internal->CompileOptionsEntries, + this->Internal->CompileOptionsItems, result, uniqueOptions, &dagChecker, @@ -2912,7 +2918,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) @@ -4365,7 +4371,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=3eeeec4015d83fc87f48042c3125c4ac76689537 commit 3eeeec4015d83fc87f48042c3125c4ac76689537 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Aug 4 20:25:02 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Aug 7 04:08:18 2015 +0200 cmTarget: Split storage of include directories from genexes. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 09c796b..195fa0d 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 8830bf2..23553c0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -136,7 +136,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; @@ -334,13 +336,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(); @@ -352,7 +354,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) @@ -406,6 +408,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) { @@ -1632,12 +1657,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") { @@ -1730,10 +1754,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") { @@ -1853,14 +1876,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); } //---------------------------------------------------------------------------- @@ -2049,7 +2074,7 @@ cmTarget::GetIncludeDirectories(const std::string& config, } processIncludeDirectories(this, - this->Internal->IncludeDirectoriesEntries, + this->Internal->IncludeDirectoriesItems, includes, uniqueIncludes, &dagChecker, @@ -2865,7 +2890,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) @@ -4339,7 +4364,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 3e689ae..dcf6832 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 */ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits