diff options
author | Brad King <brad.king@kitware.com> | 2013-07-24 15:02:33 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-07-24 15:02:33 (GMT) |
commit | e6f93dc5600645fdc2e43cb79994e55db767c6b7 (patch) | |
tree | 2af03781da692c78518fb7956e8bfc0ba8a0962f /Source/cmGlobalNinjaGenerator.cxx | |
parent | 49e8c65b9204d42dc536f1a80fc35ec832722548 (diff) | |
parent | a11da72e7b465933eb4e92eee5db8e6d334e843b (diff) | |
download | CMake-e6f93dc5600645fdc2e43cb79994e55db767c6b7.zip CMake-e6f93dc5600645fdc2e43cb79994e55db767c6b7.tar.gz CMake-e6f93dc5600645fdc2e43cb79994e55db767c6b7.tar.bz2 |
Merge topic 'windows_ninja_duplicate_paths'
a11da72 Ninja: Properly convert all paths to unix style before we do set intersection.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 245883c..61d0272 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -147,7 +147,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, //we need to track every dependency that comes in, since we are trying //to find dependencies that are side effects of build commands // - this->CombinedBuildExplicitDependencies.insert(*i); + this->CombinedBuildExplicitDependencies.insert( EncodePath(*i) ); } // Write implicit dependencies. @@ -180,7 +180,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, i != outputs.end(); ++i) { build << " " << EncodeIdent(EncodePath(*i), os); - this->CombinedBuildOutputs.insert(*i); + this->CombinedBuildOutputs.insert( EncodePath(*i) ); } build << ":"; @@ -950,7 +950,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) typedef std::vector<std::string>::const_iterator vect_it; for(vect_it j = files.begin(); j != files.end(); ++j) { - knownDependencies.insert(ng->ConvertToNinjaPath( j->c_str() )); + knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); } } @@ -965,26 +965,15 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) typedef std::vector<std::string>::const_iterator vect_it; for(vect_it j = files.begin(); j != files.end(); ++j) { - knownDependencies.insert(ng->ConvertToNinjaPath( j->c_str() )); + knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); } } - //insert outputs from all WirteBuild commands - for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin(); - i != this->CombinedBuildOutputs.end(); ++i) - { - knownDependencies.insert(*i); - } - - //after we have combined the data into knownDependencies we have no need - //to keep this data around - this->CombinedBuildOutputs.clear(); - for(TargetAliasMap::const_iterator i= this->TargetAliases.begin(); i != this->TargetAliases.end(); ++i) { - knownDependencies.insert(i->first); + knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) ); } //remove all source files we know will exist. @@ -993,11 +982,26 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) i != this->AssumedSourceDependencies.end(); ++i) { - knownDependencies.insert(i->first); + knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) ); } + //insert outputs from all WirteBuild commands + for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin(); + i != this->CombinedBuildOutputs.end(); ++i) + { + //these paths have already be encoded when added to CombinedBuildOutputs + knownDependencies.insert(*i); + } + + //after we have combined the data into knownDependencies we have no need + //to keep this data around + this->CombinedBuildOutputs.clear(); + //now we difference with CombinedBuildExplicitDependencies to find - //the list of items we know nothing about + //the list of items we know nothing about. + //We have encoded all the paths in CombinedBuildExplicitDependencies + //and knownDependencies so no matter if unix or windows paths they + //should all match now. std::vector<std::string> unkownExplicitDepends; this->CombinedBuildExplicitDependencies.erase("all"); |