diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8dce028..a4e2d55 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1592,6 +1592,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) std::string shaderEntryPoint; std::string shaderModel; std::string shaderAdditionalFlags; + std::string outputHeaderFile; + std::string variableName; std::string settingsGenerator; std::string settingsLastGenOutput; std::string sourceLink; @@ -1641,6 +1643,16 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) shaderModel = sm; toolHasSettings = true; } + // Figure out which output header file to use if any + if (const char* ohf = sf->GetProperty("VS_SHADER_OUTPUT_HEADER_FILE")) { + outputHeaderFile = ohf; + toolHasSettings = true; + } + // Figure out which variable name to use if any + if (const char* vn = sf->GetProperty("VS_SHADER_VARIABLE_NAME")) { + variableName = vn; + toolHasSettings = true; + } // Figure out if there's any additional flags to use if (const char* saf = sf->GetProperty("VS_SHADER_FLAGS")) { shaderAdditionalFlags = saf; @@ -1765,6 +1777,28 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) (*this->BuildFileStream) << cmVS10EscapeXML(shaderModel) << "</ShaderModel>\n"; } + if (!outputHeaderFile.empty()) { + for (size_t i = 0; i != this->Configurations.size(); ++i) { + this->WriteString("<HeaderFileOutput Condition=\"" + "'$(Configuration)|$(Platform)'=='", + 3); + (*this->BuildFileStream) << this->Configurations[i] << "|" + << this->Platform << "'\">" + << cmVS10EscapeXML(outputHeaderFile); + this->WriteString("</HeaderFileOutput>\n", 0); + } + } + if (!variableName.empty()) { + for (size_t i = 0; i != this->Configurations.size(); ++i) { + this->WriteString("<VariableName Condition=\"" + "'$(Configuration)|$(Platform)'=='", + 3); + (*this->BuildFileStream) << this->Configurations[i] << "|" + << this->Platform << "'\">" + << cmVS10EscapeXML(variableName); + this->WriteString("</VariableName>\n", 0); + } + } if (!shaderAdditionalFlags.empty()) { this->WriteString("<AdditionalOptions>", 3); (*this->BuildFileStream) << cmVS10EscapeXML(shaderAdditionalFlags) |