From 910a9d608e31a3446d0cbb86eb78917cc04b1a64 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Mar 2018 13:54:45 -0500 Subject: cmTarget: Simplify ClearDependencyInformation signature We don't need to pass an argument with the target's own name. --- Source/cmMakefile.cxx | 2 +- Source/cmTarget.cxx | 7 +++---- Source/cmTarget.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 47d75af..a69f75f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1867,7 +1867,7 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname, // Clear its dependencies. Otherwise, dependencies might persist // over changes in CMakeLists.txt, making the information stale and // hence useless. - target->ClearDependencyInformation(*this, lname); + target->ClearDependencyInformation(*this); if (excludeFromAll) { target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index bb21022..f7ead9f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -635,12 +635,11 @@ const std::vector& cmTarget::GetLinkDirectories() const return this->LinkDirectories; } -void cmTarget::ClearDependencyInformation(cmMakefile& mf, - const std::string& target) +void cmTarget::ClearDependencyInformation(cmMakefile& mf) { // Clear the dependencies. The cache variable must exist iff we are // recording dependency information for this target. - std::string depname = target; + std::string depname = this->GetName(); depname += "_LIB_DEPENDS"; if (this->RecordDependencies) { mf.AddCacheDefinition(depname, "", "Dependencies for target", @@ -648,7 +647,7 @@ void cmTarget::ClearDependencyInformation(cmMakefile& mf, } else { if (mf.GetDefinition(depname)) { std::string message = "Target "; - message += target; + message += this->GetName(); message += " has dependency information when it shouldn't.\n"; message += "Your cache is probably stale. Please remove the entry\n "; message += depname; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 56f3e3a..56f8975 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -137,7 +137,7 @@ public: /** * Clear the dependency information recorded for this target, if any. */ - void ClearDependencyInformation(cmMakefile& mf, const std::string& target); + void ClearDependencyInformation(cmMakefile& mf); void AddLinkLibrary(cmMakefile& mf, const std::string& lib, cmTargetLinkLibraryType llt); -- cgit v0.12