summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index c87bf71..c00d400 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -159,6 +159,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
this->Platform = gg->GetPlatformName();
this->MSTools = true;
+ this->TargetCompileAsWinRT = false;
this->BuildFileStream = 0;
this->IsMissingFiles = false;
this->DefaultArtifactDir =
@@ -1414,6 +1415,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
compileAs = "CompileAsC";
}
}
+ bool noWinRT = this->TargetCompileAsWinRT && lang == "C";
bool hasFlags = false;
// for the first time we need a new line if there is something
// produced here.
@@ -1447,7 +1449,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
// if we have flags or defines for this config then
// use them
- if(!flags.empty() || !configDefines.empty() || compileAs)
+ if(!flags.empty() || !configDefines.empty() || compileAs || noWinRT)
{
(*this->BuildFileStream ) << firstString;
firstString = ""; // only do firstString once
@@ -1460,6 +1462,10 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
{
clOptions.AddFlag("CompileAs", compileAs);
}
+ if(noWinRT)
+ {
+ clOptions.AddFlag("CompileAsWinRT", "false");
+ }
clOptions.Parse(flags.c_str());
clOptions.AddDefines(configDefines.c_str());
clOptions.SetConfiguration((*config).c_str());
@@ -1711,6 +1717,13 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("CompileAsWinRT", "false");
}
}
+ if(const char* winRT = clOptions.GetFlag("CompileAsWinRT"))
+ {
+ if(cmSystemTools::IsOn(winRT))
+ {
+ this->TargetCompileAsWinRT = true;
+ }
+ }
}
this->ClOptions[configName] = pOptions.release();