From ccf7760f0035e2e0458ba59e29ab302a2d07c388 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 14 Jun 2015 20:27:37 +0200 Subject: [PATCH 1/9] cmOutputConverter: Constify API. --- Source/cmOutputConverter.cxx | 18 +++++++++--------- Source/cmOutputConverter.h | 18 +++++++++--------- Source/cmState.cxx | 4 ++-- Source/cmState.h | 6 ++++-- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index db73a3438..b0a30a1ca 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -27,7 +27,7 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot) std::string cmOutputConverter::ConvertToOutputForExistingCommon(const std::string& remote, std::string const& result, - OutputFormat format) + OutputFormat format) const { // If this is a windows shell, the result has a space, and the path // already exists, we can use a short-path to reference it without a @@ -50,7 +50,7 @@ cmOutputConverter::ConvertToOutputForExistingCommon(const std::string& remote, std::string cmOutputConverter::ConvertToOutputForExisting(const std::string& remote, RelativeRoot local, - OutputFormat format) + OutputFormat format) const { static_cast(local); @@ -65,7 +65,7 @@ cmOutputConverter::ConvertToOutputForExisting(const std::string& remote, std::string cmOutputConverter::ConvertToOutputForExisting(RelativeRoot remote, const std::string& local, - OutputFormat format) + OutputFormat format) const { // Perform standard conversion. std::string result = this->Convert(remote, local, format, true); @@ -76,7 +76,7 @@ cmOutputConverter::ConvertToOutputForExisting(RelativeRoot remote, } //---------------------------------------------------------------------------- -const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) +const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const { switch (relroot) { @@ -91,7 +91,7 @@ const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) std::string cmOutputConverter::Convert(const std::string& source, RelativeRoot relative, - OutputFormat output) + OutputFormat output) const { // Convert the path to a relative path. std::string result = source; @@ -125,7 +125,7 @@ std::string cmOutputConverter::Convert(const std::string& source, //---------------------------------------------------------------------------- std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source, - OutputFormat output) + OutputFormat output) const { std::string result = source; // Convert it to an output path. @@ -163,7 +163,7 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source, std::string cmOutputConverter::Convert(RelativeRoot remote, const std::string& local, OutputFormat output, - bool optional) + bool optional) const { const char* remotePath = this->GetRelativeRootPath(remote); @@ -192,7 +192,7 @@ static bool cmOutputConverterNotAbove(const char* a, const char* b) std::string cmOutputConverter::ConvertToRelativePath(const std::vector& local, const std::string& in_remote, - bool force) + bool force) const { // The path should never be quoted. assert(in_remote[0] != '\"'); @@ -318,7 +318,7 @@ static bool cmOutputConverterIsShellOperator(const std::string& str) std::string cmOutputConverter::EscapeForShell(const std::string& str, bool makeVars, bool forEcho, - bool useWatcomQuote) + bool useWatcomQuote) const { // Do not escape shell operators. if(cmOutputConverterIsShellOperator(str)) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 1d3f8c75f..482a64b1c 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -39,35 +39,35 @@ public: enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT }; enum OutputFormat { UNCHANGED, MAKERULE, SHELL, WATCOMQUOTE, RESPONSE }; std::string ConvertToOutputFormat(const std::string& source, - OutputFormat output); + OutputFormat output) const; std::string Convert(const std::string& remote, RelativeRoot local, - OutputFormat output = UNCHANGED); + OutputFormat output = UNCHANGED) const; std::string Convert(RelativeRoot remote, const std::string& local, OutputFormat output = UNCHANGED, - bool optional = false); + bool optional = false) const; /** * Get path for the specified relative root. */ - const char* GetRelativeRootPath(RelativeRoot relroot); + const char* GetRelativeRootPath(RelativeRoot relroot) const; ///! for existing files convert to output path and short path if spaces std::string ConvertToOutputForExisting(const std::string& remote, RelativeRoot local = START_OUTPUT, - OutputFormat format = SHELL); + OutputFormat format = SHELL) const; /** For existing path identified by RelativeRoot convert to output path and short path if spaces. */ std::string ConvertToOutputForExisting(RelativeRoot remote, const std::string& local = "", - OutputFormat format = SHELL); + OutputFormat format = SHELL) const; void SetLinkScriptShell(bool linkScriptShell); std::string EscapeForShell(const std::string& str, bool makeVars = false, bool forEcho = false, - bool useWatcomQuote = false); + bool useWatcomQuote = false) const; static std::string EscapeForCMake(const std::string& str); @@ -88,14 +88,14 @@ public: */ std::string ConvertToRelativePath(const std::vector& local, const std::string& in_remote, - bool force = false); + bool force = false) const; private: cmState* GetState() const; std::string ConvertToOutputForExistingCommon(const std::string& remote, std::string const& result, - OutputFormat format); + OutputFormat format) const; private: cmState::Snapshot StateSnapshot; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index a13c13f14..f0c7e6dab 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -741,14 +741,14 @@ void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir) } std::vector const& -cmState::Snapshot::GetCurrentSourceDirectoryComponents() +cmState::Snapshot::GetCurrentSourceDirectoryComponents() const { return this->Position->BuildSystemDirectory ->CurrentSourceDirectoryComponents; } std::vector const& -cmState::Snapshot::GetCurrentBinaryDirectoryComponents() +cmState::Snapshot::GetCurrentBinaryDirectoryComponents() const { return this->Position->BuildSystemDirectory ->CurrentBinaryDirectoryComponents; diff --git a/Source/cmState.h b/Source/cmState.h index 353a6c60a..070a08b58 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -43,8 +43,10 @@ public: const char* GetCurrentBinaryDirectory() const; void SetCurrentBinaryDirectory(std::string const& dir); - std::vector const& GetCurrentSourceDirectoryComponents(); - std::vector const& GetCurrentBinaryDirectoryComponents(); + std::vector const& + GetCurrentSourceDirectoryComponents() const; + std::vector const& + GetCurrentBinaryDirectoryComponents() const; const char* GetRelativePathTopSource() const; const char* GetRelativePathTopBinary() const; From cfae7fa4082e73d4282be98fa99a07c18dd53d24 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 21 Jun 2015 20:16:37 +0200 Subject: [PATCH 2/9] cmMakefile: Use cmOutputConverter instead of cmLocalGenerator. --- Source/cmMakefile.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 63dbe27fc..03380623b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -264,8 +264,8 @@ void cmMakefile::IssueMessage(cmake::MessageType t, if(!this->GetCMakeInstance()->GetIsInTryCompile()) { - lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, - cmLocalGenerator::HOME); + cmOutputConverter converter(this->StateSnapshot); + lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME); } lfc.Line = 0; this->GetCMakeInstance()->IssueMessage(t, text, lfc); @@ -1963,8 +1963,8 @@ void cmMakefile::LogUnused(const char* reason, lfc.FilePath = path; lfc.Line = 0; } - lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, - cmLocalGenerator::HOME); + cmOutputConverter converter(this->StateSnapshot); + lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME); if (this->CheckSystemVars || cmSystemTools::IsSubDirectory(path, @@ -2861,8 +2861,9 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( { std::ostringstream msg; cmListFileContext lfc; - lfc.FilePath = this->LocalGenerator - ->Convert(filename, cmLocalGenerator::HOME); + cmOutputConverter converter(this->StateSnapshot); + lfc.FilePath = + converter.Convert(filename, cmOutputConverter::HOME); lfc.Line = line; msg << "uninitialized variable \'" << lookup << "\'"; this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, From eb05dcd6c9b587eeb8738d9f08459d94733708f6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 13 Jun 2015 19:32:46 +0200 Subject: [PATCH 3/9] cmLocalGenerator: Add IssueMessage method. For use at generate-time instead of the cmMakefile method of the same name. --- Source/cmGeneratorTarget.cxx | 3 ++- Source/cmLocalGenerator.cxx | 30 +++++++++++++++++++++++------- Source/cmLocalGenerator.h | 4 ++++ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 67d0d5433..2f68ab031 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -705,7 +705,8 @@ cmTargetTraceDependencies e << "Evaluation output file\n \"" << sf->GetFullPath() << "\"\ndepends on the sources of a target it is used in. This " "is a dependency loop and is not allowed."; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + this->GeneratorTarget + ->LocalGenerator->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } if(emitted.insert(sf).second && this->SourcesQueued.insert(sf).second) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 98accf9cf..a42d5a755 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -73,6 +73,22 @@ bool cmLocalGenerator::IsRootMakefile() const return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid(); } +void cmLocalGenerator::IssueMessage(cmake::MessageType t, + std::string const& text) const +{ + cmListFileContext lfc; + lfc.FilePath = this->StateSnapshot.GetCurrentSourceDirectory(); + lfc.FilePath += "/CMakeLists.txt"; + + if(!this->GlobalGenerator->GetCMakeInstance()->GetIsInTryCompile()) + { + cmOutputConverter converter(this->StateSnapshot); + lfc.FilePath = converter.Convert(lfc.FilePath, cmLocalGenerator::HOME); + } + lfc.Line = 0; + this->GlobalGenerator->GetCMakeInstance()->IssueMessage(t, text, lfc); +} + //---------------------------------------------------------------------------- void cmLocalGenerator::ComputeObjectMaxPath() { @@ -98,7 +114,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax << ", which is less than the minimum of 128. " << "The value will be ignored."; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); + this->IssueMessage(cmake::AUTHOR_WARNING, w.str()); } } else @@ -107,7 +123,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen << "\", which fails to parse as a positive integer. " << "The value will be ignored."; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); + this->IssueMessage(cmake::AUTHOR_WARNING, w.str()); } } this->ObjectMaxPathViolations.clear(); @@ -1317,7 +1333,7 @@ void cmLocalGenerator::AddCompileOptions( "higher \"" << it->first << "_STANDARD\" \"" << standard << "\". " "This is not permitted. The COMPILE_FEATURES may not both depend on " "and be depended on by the link implementation." << std::endl; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + this->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } } @@ -2041,7 +2057,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target, "dialect \"" << lang << standardProp << "\" " << (ext ? "(with compiler extensions)" : "") << ", but CMake " "does not know the compile flags to use to enable it."; - this->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str()); + this->IssueMessage(cmake::FATAL_ERROR, e.str()); } else { @@ -2085,7 +2101,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget const* target, std::string e = "CMAKE_" + lang + "_STANDARD_DEFAULT is set to invalid value '" + std::string(defaultStd) + "'"; - this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, e); + this->IssueMessage(cmake::INTERNAL_ERROR, e); return; } @@ -2301,7 +2317,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, << flagsVar << " was removed.\n" << cmPolicies::GetPolicyWarning(cmPolicies::CMP0018); - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + this->IssueMessage(cmake::AUTHOR_WARNING, e.str()); // fall through to OLD behaviour } case cmPolicies::OLD: @@ -2813,7 +2829,7 @@ cmLocalGenerator << " " << ssin << "\n" << "cannot be safely placed under this directory. " << "The build may not work correctly."; - this->Makefile->IssueMessage(cmake::WARNING, m.str()); + this->IssueMessage(cmake::WARNING, m.str()); } } #else diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6a8c5aa5f..4452eef65 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -14,6 +14,7 @@ #include "cmStandardIncludes.h" #include "cmState.h" +#include "cmake.h" #include "cmOutputConverter.h" class cmMakefile; @@ -304,6 +305,9 @@ public: bool IsMinGWMake() const; bool IsNMake() const; + void IssueMessage(cmake::MessageType t, std::string const& text) const; + + void ComputeObjectMaxPath(); protected: ///! put all the libraries for a target on into the given stream From 217c243db04a21763848ac048edf153cd93bd883 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 14 Jun 2015 01:08:34 +0200 Subject: [PATCH 4/9] cmake: Update the current snapshot when Resetting. This will matter when definitions are stored in the cmState. --- Source/cmState.cxx | 6 ++++-- Source/cmState.h | 2 +- Source/cmake.cxx | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/cmState.cxx b/Source/cmState.cxx index f0c7e6dab..58500cc10 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -219,13 +219,13 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, ->GetCacheIterator(key.c_str()).SetProperty(propertyName, (void*)0); } -void cmState::Reset() +cmState::Snapshot cmState::Reset() { this->GlobalProperties.clear(); this->PropertyDefinitions.clear(); this->BuildsystemDirectory.Truncate(); - this->SnapshotData.Truncate(); + PositionType pos = this->SnapshotData.Truncate(); this->DefineProperty ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY, @@ -246,6 +246,8 @@ void cmState::Reset() this->DefineProperty ("RULE_LAUNCH_CUSTOM", cmProperty::TARGET, "", "", true); + + return Snapshot(this, pos); } void cmState::DefineProperty(const std::string& name, diff --git a/Source/cmState.h b/Source/cmState.h index 070a08b58..9c7574f7b 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -105,7 +105,7 @@ public: void RemoveCacheEntryProperty(std::string const& key, std::string const& propertyName); - void Reset(); + Snapshot Reset(); // Define a property void DefineProperty(const std::string& name, cmProperty::ScopeType scope, const char *ShortDescription, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index eeb6575c0..e51b260cd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -186,7 +186,7 @@ cmake::~cmake() void cmake::CleanupCommandsAndMacros() { - this->State->Reset(); + this->CurrentSnapshot = this->State->Reset(); this->State->RemoveUserDefinedCommands(); } @@ -370,6 +370,7 @@ void cmake::ReadListFile(const std::vector& args, // read in the list file to fill the cache if(path) { + this->CurrentSnapshot = this->State->Reset(); std::string homeDir = this->GetHomeDirectory(); std::string homeOutputDir = this->GetHomeOutputDirectory(); this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); From 8bfaadfa394c9b462259ea13df6b2df7c4544ab4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 14:07:15 +0200 Subject: [PATCH 5/9] cmMakefile: Move IsRoot API from cmLocalGenerator. --- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 ++-- Source/cmLocalGenerator.cxx | 5 ----- Source/cmLocalGenerator.h | 3 --- Source/cmLocalNinjaGenerator.cxx | 4 ++-- Source/cmMakefile.cxx | 5 +++++ Source/cmMakefile.h | 3 +++ Source/cmProjectCommand.cxx | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 4fe52dde7..0f61225f5 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -529,7 +529,7 @@ cmGlobalUnixMakefileGenerator3 cmLocalUnixMakefileGenerator3* lg) { // Only subdirectories need these rules. - if(lg->IsRootMakefile()) + if(lg->GetMakefile()->IsRootMakefile()) { return; } @@ -1034,7 +1034,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule static_cast(this->LocalGenerators[i]); // for the passed in makefile or if this is the top Makefile wripte out // the targets - if (lg2 == lg || lg->IsRootMakefile()) + if (lg2 == lg || lg->GetMakefile()->IsRootMakefile()) { // for each target Generate the rule files for each target. cmTargets& targets = lg2->GetMakefile()->GetTargets(); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a42d5a755..119cba9d8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -68,11 +68,6 @@ cmLocalGenerator::~cmLocalGenerator() delete this->Makefile; } -bool cmLocalGenerator::IsRootMakefile() const -{ - return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid(); -} - void cmLocalGenerator::IssueMessage(cmake::MessageType t, std::string const& text) const { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 4452eef65..a3f95886e 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -40,9 +40,6 @@ public: cmState::Snapshot snapshot); virtual ~cmLocalGenerator(); - /// @return whether we are processing the top CMakeLists.txt file. - bool IsRootMakefile() const; - /** * Generate the makefile for this directory. */ diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 427ae106c..4db36fc5b 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -58,7 +58,7 @@ void cmLocalNinjaGenerator::Generate() #endif // We do that only once for the top CMakeLists.txt file. - if(this->IsRootMakefile()) + if(this->Makefile->IsRootMakefile()) { this->WriteBuildFileTop(); @@ -298,7 +298,7 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os) << "# Write statements declared in CMakeLists.txt:" << std::endl << "# " << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl; - if(this->IsRootMakefile()) + if(this->Makefile->IsRootMakefile()) os << "# Which is the root file." << std::endl; cmGlobalNinjaGenerator::WriteDivider(os); os << std::endl; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 03380623b..cf7897e4b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1608,6 +1608,11 @@ void cmMakefile::PopMacroScope(bool reportError) this->PopFunctionBlockerBarrier(reportError); } +bool cmMakefile::IsRootMakefile() const +{ + return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid(); +} + //---------------------------------------------------------------------------- class cmMakefileCurrent { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 86bde0ca7..44bd8c61c 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -90,6 +90,9 @@ public: */ void AddFunctionBlocker(cmFunctionBlocker* fb); + /// @return whether we are processing the top CMakeLists.txt file. + bool IsRootMakefile() const; + /** * Remove the function blocker whose scope ends with the given command. * This returns ownership of the function blocker object. diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 90bc1115e..46d7e0113 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -53,7 +53,7 @@ bool cmProjectCommand // CMAKE_PROJECT_NAME will match PROJECT_NAME, and cmake --build // will work. if(!this->Makefile->GetDefinition("CMAKE_PROJECT_NAME") - || (this->Makefile->GetLocalGenerator()->IsRootMakefile())) + || (this->Makefile->IsRootMakefile())) { this->Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str()); this->Makefile->AddCacheDefinition From 080489b8a92253bedbb67cc7958351350f4b2341 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 14:39:27 +0200 Subject: [PATCH 6/9] cmMakefile: Use member directly instead of through method. This function will not be around much longer anyway. --- Source/cmMakefile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cf7897e4b..64d863861 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -105,7 +105,7 @@ public: ++it; if(it == this->VarStack.rend()) { - cmLocalGenerator* plg = mf->GetLocalGenerator()->GetParent(); + cmLocalGenerator* plg = mf->LocalGenerator->GetParent(); if(!plg) { return false; From 61c0113c13fe4a65c394e56cc0354db0b80d9c4c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 13:06:47 +0200 Subject: [PATCH 7/9] cmLocalUnixMakefileGenerator3: Remove unused method. --- Source/cmLocalUnixMakefileGenerator3.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 4e4d146a9..b097c95ed 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -149,9 +149,6 @@ public: void AddImplicitDepends(cmTarget const& tgt, const std::string& lang, const char* obj, const char* src); - void AppendGlobalTargetDepends(std::vector& depends, - cmTarget& target); - // write the target rules for the local Makefile into the stream void WriteLocalAllRules(std::ostream& ruleFileStream); From b3e2e332eb9c2a7d73ec872664cee896248c6c38 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 14:59:22 +0200 Subject: [PATCH 8/9] QtAutogen: Get the global generator from the Makefile. --- Source/cmQtAutoGenerators.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f472ed8ee..53fea8379 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -368,8 +368,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) #if defined(_WIN32) && !defined(__CYGWIN__) bool usePRE_BUILD = false; - cmLocalGenerator* localGen = makefile->GetLocalGenerator(); - cmGlobalGenerator* gg = localGen->GetGlobalGenerator(); + cmGlobalGenerator* gg = makefile->GetGlobalGenerator(); if(gg->GetName().find("Visual Studio") != std::string::npos) { cmGlobalVisualStudioGenerator* vsgg = From 820986edfff97779bb0c84fd9da3b284921c8ae4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 6 Jun 2015 12:57:19 +0200 Subject: [PATCH 9/9] cmLocalGenerator: Constify GetIncludeDirectories method. --- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalGenerator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 119cba9d8..6f98ee2a0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1341,7 +1341,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, const std::string& lang, const std::string& config, bool stripImplicitInclDirs - ) + ) const { // Need to decide whether to automatically include the source and // binary directories at the beginning of the include path. diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index a3f95886e..98f4d3a22 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -183,7 +183,7 @@ public: cmGeneratorTarget* target, const std::string& lang = "C", const std::string& config = "", - bool stripImplicitInclDirs = true); + bool stripImplicitInclDirs = true) const; void AddCompileOptions(std::string& flags, cmTarget* target, const std::string& lang, const std::string& config); void AddCompileDefinitions(std::set& defines,