From 089868a244e623f75c1ffbe9297d3228bef9a8f1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 16 Sep 2016 16:23:40 -0400 Subject: cmState: Record buildsystem target names in each directory Maintain in the directory state the list of target names added to be built. These are normal, non-imported targets (but do include INTERFACE libraries). --- Source/cmMakefile.cxx | 1 + Source/cmState.cxx | 8 ++++++++ Source/cmState.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 508c670..50e7b33 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1930,6 +1930,7 @@ cmTarget* cmMakefile::AddNewTarget(cmState::TargetType type, name, cmTarget(name, type, cmTarget::VisibilityNormal, this))) .first; this->GetGlobalGenerator()->IndexTarget(&it->second); + this->GetStateSnapshot().GetDirectory().AddNormalTargetName(name); return &it->second; } diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ffb104b..2ff4516 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -94,6 +94,8 @@ struct cmState::BuildsystemDirectoryStateType std::vector CompileOptions; std::vector CompileOptionsBacktraces; + std::vector NormalTargetNames; + std::string ProjectName; cmPropertyMap Properties; @@ -324,6 +326,7 @@ cmState::Snapshot cmState::Reset() it->CompileOptions.clear(); it->CompileOptionsBacktraces.clear(); it->DirectoryEnd = pos; + it->NormalTargetNames.clear(); it->Properties.clear(); it->Children.clear(); } @@ -1733,6 +1736,11 @@ std::vector cmState::Directory::GetPropertyKeys() const return keys; } +void cmState::Directory::AddNormalTargetName(std::string const& name) +{ + this->DirectoryState->NormalTargetNames.push_back(name); +} + bool operator==(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs) { return lhs.Position == rhs.Position; diff --git a/Source/cmState.h b/Source/cmState.h index 0fac42c..1324f5f 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -175,6 +175,8 @@ public: bool GetPropertyAsBool(const std::string& prop) const; std::vector GetPropertyKeys() const; + void AddNormalTargetName(std::string const& name); + private: void ComputeRelativePathTopSource(); void ComputeRelativePathTopBinary(); -- cgit v0.12