summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-06 19:00:54 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-06 19:38:16 (GMT)
commit1c5bfab532e96bc728691a15b092d388a9e0a0d5 (patch)
treef65fc9bc917a993b4a1163037f395b472fb5e7b8
parent910a9d608e31a3446d0cbb86eb78917cc04b1a64 (diff)
downloadCMake-1c5bfab532e96bc728691a15b092d388a9e0a0d5.zip
CMake-1c5bfab532e96bc728691a15b092d388a9e0a0d5.tar.gz
CMake-1c5bfab532e96bc728691a15b092d388a9e0a0d5.tar.bz2
cmTarget: Simplify ClearDependencyInformation implementation
Remove the `<target>_LIB_DEPENDS` cache entry unconditionally. It will be populated again later if needed. There is no need to ask the user to remove the cache entry if the target type changes. Issue: #16364
-rw-r--r--Source/cmTarget.cxx17
1 files changed, 1 insertions, 16 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f7ead9f..b868e84 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -637,24 +637,9 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
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 = this->GetName();
depname += "_LIB_DEPENDS";
- if (this->RecordDependencies) {
- mf.AddCacheDefinition(depname, "", "Dependencies for target",
- cmStateEnums::STATIC);
- } else {
- if (mf.GetDefinition(depname)) {
- std::string 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;
- message += "\nfrom the cache.";
- cmSystemTools::Error(message.c_str());
- }
- }
+ mf.RemoveCacheDefinition(depname);
}
std::string cmTarget::GetDebugGeneratorExpressions(