summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-18 22:29:18 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-20 20:36:57 (GMT)
commit21b0654ace2ce58d191c2e42a8583b05614cd037 (patch)
tree391d98c3e15d46a295cb3e0896e328ca25f7dc5d /Source
parent416df93aa93d0a633f0e7354d0562934f676768b (diff)
downloadCMake-21b0654ace2ce58d191c2e42a8583b05614cd037.zip
CMake-21b0654ace2ce58d191c2e42a8583b05614cd037.tar.gz
CMake-21b0654ace2ce58d191c2e42a8583b05614cd037.tar.bz2
cmGlobalGenerator: Convert set insert algorithm to vector algorithms.
Adjust test for new error output.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx26
1 files changed, 17 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 93692f6..6147009 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -3015,7 +3015,7 @@ void cmGlobalGenerator::AddEvaluationFile(const std::string &inputFile,
//----------------------------------------------------------------------------
void cmGlobalGenerator::ProcessEvaluationFiles()
{
- std::set<std::string> generatedFiles;
+ std::vector<std::string> generatedFiles;
for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
li = this->EvaluationFiles.begin();
li != this->EvaluationFiles.end();
@@ -3027,16 +3027,24 @@ void cmGlobalGenerator::ProcessEvaluationFiles()
return;
}
std::vector<std::string> files = (*li)->GetFiles();
- for(std::vector<std::string>::const_iterator fi = files.begin();
- fi != files.end(); ++fi)
+ std::sort(files.begin(), files.end());
+
+ std::vector<std::string> intersection;
+ std::set_intersection(files.begin(), files.end(),
+ generatedFiles.begin(), generatedFiles.end(),
+ std::back_inserter(intersection));
+ if (!intersection.empty())
{
- if (!generatedFiles.insert(*fi).second)
- {
- cmSystemTools::Error("File to be generated by multiple different "
- "commands: ", fi->c_str());
- return;
- }
+ cmSystemTools::Error("Files to be generated by multiple different "
+ "commands: ", cmWrap('"', intersection, '"', " ").c_str());
+ return;
}
+
+ generatedFiles.insert(generatedFiles.end(),
+ files.begin(), files.end());
+ std::vector<std::string>::iterator newIt =
+ generatedFiles.end() - files.size();
+ std::inplace_merge(generatedFiles.begin(), newIt, generatedFiles.end());
}
}