From 7a2e114dd8ab55bc9ef9e1106ae352d2fea558d3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 14 Sep 2016 14:34:36 -0400 Subject: [PATCH] cmTarget: Inline SetType method at only remaining call site --- Source/cmTarget.cxx | 15 ++++++--------- Source/cmTarget.h | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 15610e5376..d964f0021e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -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 diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 8a1d27e07b..ebc92f31a9 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -283,7 +283,6 @@ public: }; private: - void SetType(cmState::TargetType f, const std::string& name); void SetMakefile(cmMakefile* mf); bool HandleLocationPropertyPolicy(cmMakefile* context) const;