diff options
author | Brad King <brad.king@kitware.com> | 2009-09-04 16:39:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-04 16:39:05 (GMT) |
commit | 4eb5f1bef6d2e082e1221afb3fdfe4598dab350e (patch) | |
tree | df2dd8272ee43b2a86a8e471795989178d1bc44b /Source/cmTarget.cxx | |
parent | 053519b390ced4e2ed702f00a00d23ad344a3da3 (diff) | |
download | CMake-4eb5f1bef6d2e082e1221afb3fdfe4598dab350e.zip CMake-4eb5f1bef6d2e082e1221afb3fdfe4598dab350e.tar.gz CMake-4eb5f1bef6d2e082e1221afb3fdfe4598dab350e.tar.bz2 |
Cleanup cmTarget source file list representation
This teaches cmTarget to use a set of cmSourceFile pointers to guarantee
unique insertion of source files in a target. The order of insertion is
still preserved in the SourceFiles vector.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8b4ac6f..26c0e39 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1089,7 +1089,6 @@ private: cmGlobalGenerator* GlobalGenerator; std::queue<cmStdString> DependencyQueue; std::set<cmStdString> DependenciesQueued; - std::set<cmSourceFile*> TargetSources; void QueueOnce(std::string const& name); void QueueOnce(std::vector<std::string> const& names); @@ -1120,9 +1119,6 @@ cmTargetTraceDependencies // Queue the dependencies of the source file in case they are // generated. this->QueueDependencies(*si); - - // Track the sources already known to the target. - this->TargetSources.insert(*si); } // Queue the VS project file to check dependencies on the rule to @@ -1156,10 +1152,7 @@ void cmTargetTraceDependencies::Trace() this->QueueDependencies(sf); // Make sure this file is in the target. - if(this->TargetSources.insert(sf).second) - { - this->Target->AddSourceFile(sf); - } + this->Target->AddSourceFile(sf); } } } @@ -1331,6 +1324,21 @@ bool cmTarget::FindSourceFiles() } //---------------------------------------------------------------------------- +std::vector<cmSourceFile*> const& cmTarget::GetSourceFiles() +{ + return this->SourceFiles; +} + +//---------------------------------------------------------------------------- +void cmTarget::AddSourceFile(cmSourceFile* sf) +{ + if(this->SourceFileSet.insert(sf).second) + { + this->SourceFiles.push_back(sf); + } +} + +//---------------------------------------------------------------------------- void cmTarget::AddSources(std::vector<std::string> const& srcs) { for(std::vector<std::string>::const_iterator i = srcs.begin(); |