cmTarget: Inline SetType method at only remaining call site

This commit is contained in:
Brad King 2016-09-14 14:34:36 -04:00
parent 00e78c1990
commit 7a2e114dd8
2 changed files with 6 additions and 10 deletions

View File

@ -63,6 +63,8 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type,
Visibility vis, cmMakefile* mf)
{
assert(mf || type == cmState::GLOBAL_TARGET);
this->Name = name;
this->TargetTypeValue = type;
this->Makefile = CM_NULLPTR;
this->HaveInstallRule = false;
this->DLLPlatform = false;
@ -71,23 +73,18 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type,
(vis == VisibilityImported || vis == VisibilityImportedGlobally);
this->ImportedGloballyVisible = vis == VisibilityImportedGlobally;
this->BuildInterfaceIncludesAppended = false;
this->SetType(type, name);
if (mf) {
this->SetMakefile(mf);
}
}
void cmTarget::SetType(cmState::TargetType type, const std::string& name)
{
this->Name = name;
// only add dependency information for library targets
this->TargetTypeValue = type;
if (this->TargetTypeValue >= cmState::STATIC_LIBRARY &&
this->TargetTypeValue <= cmState::MODULE_LIBRARY) {
this->RecordDependencies = true;
} else {
this->RecordDependencies = false;
}
if (mf) {
this->SetMakefile(mf);
}
}
cmTarget cmTarget::CopyForDirectory(cmMakefile* mf) const

View File

@ -283,7 +283,6 @@ public:
};
private:
void SetType(cmState::TargetType f, const std::string& name);
void SetMakefile(cmMakefile* mf);
bool HandleLocationPropertyPolicy(cmMakefile* context) const;