cmTarget: Remove unnecessary RecordDependencies member

Inline the condition in the one remaining place it is checked.
This commit is contained in:
Brad King
2018-03-06 14:03:55 -05:00
parent 1c5bfab532
commit 2124a1364a
2 changed files with 3 additions and 11 deletions

View File

@@ -186,14 +186,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->ImportedGloballyVisible = vis == VisibilityImportedGlobally;
this->BuildInterfaceIncludesAppended = false;
// only add dependency information for library targets
if (this->TargetTypeValue >= cmStateEnums::STATIC_LIBRARY &&
this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY) {
this->RecordDependencies = true;
} else {
this->RecordDependencies = false;
}
// Check whether this is a DLL platform.
this->DLLPlatform =
(this->Makefile->IsOn("WIN32") || this->Makefile->IsOn("CYGWIN") ||
@@ -736,7 +728,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
this->OriginalLinkLibraries.emplace_back(lib, llt);
}
// Add the explicit dependency information for this target. This is
// Add the explicit dependency information for libraries. This is
// simply a set of libraries separated by ";". There should always
// be a trailing ";". These library names are not canonical, in that
// they may be "-framework x", "-ly", "/path/libz.a", etc.
@@ -744,7 +736,8 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
// may be purposefully duplicated to handle recursive dependencies,
// and we removing one instance will break the link line. Duplicates
// will be appropriately eliminated at emit time.
if (this->RecordDependencies) {
if (this->TargetTypeValue >= cmStateEnums::STATIC_LIBRARY &&
this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY) {
std::string targetEntry = this->Name;
targetEntry += "_LIB_DEPENDS";
std::string dependencies;

View File

@@ -310,7 +310,6 @@ private:
cmTargetInternalPointer Internal;
cmStateEnums::TargetType TargetTypeValue;
bool HaveInstallRule;
bool RecordDependencies;
bool DLLPlatform;
bool IsAndroid;
bool IsImportedTarget;