diff options
author | Brad King <brad.king@kitware.com> | 2021-06-10 19:38:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-10 19:41:18 (GMT) |
commit | ea6d338ea10cd9a567e727cbf3d365966cb6f43c (patch) | |
tree | b2f47b7a8e4cba9976a0ca29c0371670b7cfde78 | |
parent | 5fd68d3ef75d590da383b5189ee7f952bd560a30 (diff) | |
download | CMake-ea6d338ea10cd9a567e727cbf3d365966cb6f43c.zip CMake-ea6d338ea10cd9a567e727cbf3d365966cb6f43c.tar.gz CMake-ea6d338ea10cd9a567e727cbf3d365966cb6f43c.tar.bz2 |
cmState: Record imported target names in each directory
Model the change after commit 089868a244 (cmState: Record buildsystem
target names in each directory, 2016-09-16, v3.7.0-rc1~79^2~3).
-rw-r--r-- | Source/cmMakefile.cxx | 1 | ||||
-rw-r--r-- | Source/cmState.cxx | 1 | ||||
-rw-r--r-- | Source/cmStateDirectory.cxx | 5 | ||||
-rw-r--r-- | Source/cmStateDirectory.h | 1 | ||||
-rw-r--r-- | Source/cmStatePrivate.h | 1 |
5 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 908b3f0..d2d34f9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4134,6 +4134,7 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name, // Add to the set of available imported targets. this->ImportedTargets[name] = target.get(); this->GetGlobalGenerator()->IndexTarget(target.get()); + this->GetStateSnapshot().GetDirectory().AddImportedTargetName(name); // Transfer ownership to this cmMakefile object. this->ImportedTargetsOwned.push_back(std::move(target)); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index d97762b..0b8a64b 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -286,6 +286,7 @@ cmStateSnapshot cmState::Reset() it->LinkDirectoriesBacktraces.clear(); it->DirectoryEnd = pos; it->NormalTargetNames.clear(); + it->ImportedTargetNames.clear(); it->Properties.Clear(); it->Children.clear(); } diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 9ae2861..76201cd 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -546,3 +546,8 @@ void cmStateDirectory::AddNormalTargetName(std::string const& name) { this->DirectoryState->NormalTargetNames.push_back(name); } + +void cmStateDirectory::AddImportedTargetName(std::string const& name) +{ + this->DirectoryState->ImportedTargetNames.emplace_back(name); +} diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index ce00dbb..b8abccb 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -81,6 +81,7 @@ public: std::vector<std::string> GetPropertyKeys() const; void AddNormalTargetName(std::string const& name); + void AddImportedTargetName(std::string const& name); private: cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index a437ce2..6f475f2 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -83,6 +83,7 @@ struct cmStateDetail::BuildsystemDirectoryStateType std::vector<cmListFileBacktrace> LinkDirectoriesBacktraces; std::vector<std::string> NormalTargetNames; + std::vector<std::string> ImportedTargetNames; std::string ProjectName; |