Browse Source

cmTarget: Remove unnecessary RecordDependencies member

Inline the condition in the one remaining place it is checked.
pull/320/head
Brad King 8 years ago
parent
commit
2124a1364a
  1. 13
      Source/cmTarget.cxx
  2. 1
      Source/cmTarget.h

13
Source/cmTarget.cxx

@ -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;

1
Source/cmTarget.h

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

Loading…
Cancel
Save