diff options
author | Brad King <brad.king@kitware.com> | 2016-09-14 18:28:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-14 18:50:39 (GMT) |
commit | 00e78c19903c24bb7cc969f3b825b2502661f3c0 (patch) | |
tree | 7de3b40f4c5208560a5053e1a9b7ec39035e4164 /Source/cmTarget.cxx | |
parent | 9d11bd50661a1fb0a079c7c17120273f21ea9a8c (diff) | |
download | CMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.zip CMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.tar.gz CMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.tar.bz2 |
cmTarget: Construct with basic information up front
Avoid having partially constructed cmTarget instances around,
except for the special case of GLOBAL_TARGET construction.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index dc3944c..15610e5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -59,15 +59,22 @@ public: std::vector<cmListFileBacktrace> LinkImplementationPropertyBacktraces; }; -cmTarget::cmTarget() +cmTarget::cmTarget(std::string const& name, cmState::TargetType type, + Visibility vis, cmMakefile* mf) { + assert(mf || type == cmState::GLOBAL_TARGET); this->Makefile = CM_NULLPTR; this->HaveInstallRule = false; this->DLLPlatform = false; this->IsAndroid = false; - this->IsImportedTarget = false; - this->ImportedGloballyVisible = false; + this->IsImportedTarget = + (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) @@ -1071,12 +1078,6 @@ void cmTarget::CheckProperty(const std::string& prop, } } -void cmTarget::MarkAsImported(bool global) -{ - this->IsImportedTarget = true; - this->ImportedGloballyVisible = global; -} - bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { if (this->IsImported()) { |