|
|
@@ -38,13 +38,15 @@ cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
|
|
|
+ const std::string& lang,
|
|
|
cmCompiledGeneratorExpression* inputExpression,
|
|
|
std::map<std::string, std::string> &outputFiles, mode_t perm)
|
|
|
{
|
|
|
std::string rawCondition = this->Condition->GetInput();
|
|
|
if (!rawCondition.empty())
|
|
|
{
|
|
|
- std::string condResult = this->Condition->Evaluate(this->Makefile, config);
|
|
|
+ std::string condResult = this->Condition->Evaluate(this->Makefile, config,
|
|
|
+ false, 0, 0, 0, lang);
|
|
|
if (condResult == "0")
|
|
|
{
|
|
|
return;
|
|
|
@@ -60,9 +62,11 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
|
|
|
}
|
|
|
|
|
|
const std::string outputFileName
|
|
|
- = this->OutputFileExpr->Evaluate(this->Makefile, config);
|
|
|
+ = this->OutputFileExpr->Evaluate(this->Makefile, config,
|
|
|
+ false, 0, 0, 0, lang);
|
|
|
const std::string outputContent
|
|
|
- = inputExpression->Evaluate(this->Makefile, config);
|
|
|
+ = inputExpression->Evaluate(this->Makefile, config,
|
|
|
+ false, 0, 0, 0, lang);
|
|
|
|
|
|
std::map<std::string, std::string>::iterator it
|
|
|
= outputFiles.find(outputFileName);
|
|
|
@@ -75,7 +79,8 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
|
|
|
}
|
|
|
std::ostringstream e;
|
|
|
e << "Evaluation file to be written multiple times for different "
|
|
|
- "configurations with different content:\n " << outputFileName;
|
|
|
+ "configurations or languages with different content:\n "
|
|
|
+ << outputFileName;
|
|
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
|
|
return;
|
|
|
}
|
|
|
@@ -97,14 +102,22 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
|
|
|
void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
|
|
|
std::string const& config)
|
|
|
{
|
|
|
- std::string name = this->OutputFileExpr->Evaluate(this->Makefile, config);
|
|
|
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(name);
|
|
|
- sf->SetProperty("GENERATED", "1");
|
|
|
-
|
|
|
+ std::vector<std::string> enabledLanguages;
|
|
|
cmGlobalGenerator *gg
|
|
|
= this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
|
|
|
- gg->SetFilenameTargetDepends(sf,
|
|
|
+ gg->GetEnabledLanguages(enabledLanguages);
|
|
|
+
|
|
|
+ for(std::vector<std::string>::const_iterator le = enabledLanguages.begin();
|
|
|
+ le != enabledLanguages.end(); ++le)
|
|
|
+ {
|
|
|
+ std::string name = this->OutputFileExpr->Evaluate(this->Makefile, config,
|
|
|
+ false, 0, 0, 0, *le);
|
|
|
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(name);
|
|
|
+ sf->SetProperty("GENERATED", "1");
|
|
|
+
|
|
|
+ gg->SetFilenameTargetDepends(sf,
|
|
|
this->OutputFileExpr->GetSourceSensitiveTargets());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
@@ -153,13 +166,23 @@ void cmGeneratorExpressionEvaluationFile::Generate()
|
|
|
{
|
|
|
allConfigs.push_back("");
|
|
|
}
|
|
|
- for(std::vector<std::string>::const_iterator li = allConfigs.begin();
|
|
|
- li != allConfigs.end(); ++li)
|
|
|
+
|
|
|
+ std::vector<std::string> enabledLanguages;
|
|
|
+ cmGlobalGenerator *gg
|
|
|
+ = this->Makefile->GetLocalGenerator()->GetGlobalGenerator();
|
|
|
+ gg->GetEnabledLanguages(enabledLanguages);
|
|
|
+
|
|
|
+ for(std::vector<std::string>::const_iterator le = enabledLanguages.begin();
|
|
|
+ le != enabledLanguages.end(); ++le)
|
|
|
{
|
|
|
- this->Generate(*li, inputExpression.get(), outputFiles, perm);
|
|
|
- if(cmSystemTools::GetFatalErrorOccured())
|
|
|
+ for(std::vector<std::string>::const_iterator li = allConfigs.begin();
|
|
|
+ li != allConfigs.end(); ++li)
|
|
|
{
|
|
|
- return;
|
|
|
+ this->Generate(*li, *le, inputExpression.get(), outputFiles, perm);
|
|
|
+ if(cmSystemTools::GetFatalErrorOccured())
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|