summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-01 10:05:13 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-01 11:07:11 (GMT)
commit6c0e9ee276e9e35a970990baec09c0c2c85b3804 (patch)
tree1ab194088ca83c2e6bcb6c5bfd09ac69a8e3be13 /Source/cmGlobalGenerator.cxx
parent9432b14e916421a727265f9a05dc1fbe6c6ec381 (diff)
downloadCMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.zip
CMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.tar.gz
CMake-6c0e9ee276e9e35a970990baec09c0c2c85b3804.tar.bz2
cmMakefile: Store EvaluationFiles.
Relieve the cmGlobalGenerator of this responsibility. Evaluate the generator expressions in the context of the cmLocalGenerator.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx56
1 files changed, 6 insertions, 50 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1d6608b..d6d36d4 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -30,7 +30,6 @@
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmExportBuildFileGenerator.h"
#include "cmCPackPropertiesGenerator.h"
#include "cmAlgorithms.h"
@@ -1561,9 +1560,6 @@ void cmGlobalGenerator::ClearGeneratorMembers()
cmDeleteAll(this->GeneratorTargets);
this->GeneratorTargets.clear();
- cmDeleteAll(this->EvaluationFiles);
- this->EvaluationFiles.clear();
-
cmDeleteAll(this->BuildExportSets);
this->BuildExportSets.clear();
@@ -3032,61 +3028,21 @@ cmGlobalGenerator::GetFilenameTargetDepends(cmSourceFile* sf) const {
void cmGlobalGenerator::CreateEvaluationSourceFiles(
std::string const& config) const
{
- for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
- li = this->EvaluationFiles.begin();
- li != this->EvaluationFiles.end();
- ++li)
+ unsigned int i;
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
{
- (*li)->CreateOutputFile(config);
+ this->LocalGenerators[i]->CreateEvaluationFileOutputs(config);
}
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::AddEvaluationFile(const std::string &inputFile,
- cmsys::auto_ptr<cmCompiledGeneratorExpression> outputExpr,
- cmMakefile *makefile,
- cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
- bool inputIsContent)
-{
- this->EvaluationFiles.push_back(
- new cmGeneratorExpressionEvaluationFile(inputFile, outputExpr,
- makefile, condition,
- inputIsContent));
-}
-
-//----------------------------------------------------------------------------
void cmGlobalGenerator::ProcessEvaluationFiles()
{
std::vector<std::string> generatedFiles;
- for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
- li = this->EvaluationFiles.begin();
- li != this->EvaluationFiles.end();
- ++li)
+ unsigned int i;
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
{
- (*li)->Generate();
- if (cmSystemTools::GetFatalErrorOccured())
- {
- return;
- }
- std::vector<std::string> files = (*li)->GetFiles();
- 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())
- {
- 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());
+ this->LocalGenerators[i]->ProcessEvaluationFiles(generatedFiles);
}
}