diff options
author | Brad King <brad.king@kitware.com> | 2017-09-29 12:56:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-29 12:56:04 (GMT) |
commit | 59285ee58ea2a02b53ca1e429ded198ee2c2fd21 (patch) | |
tree | 2d4d4582a2a5f68a1885c77dc7dd83052ffdffc5 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 9fc0453140b6d35af1dd627d4a2e0ea95a2feaff (diff) | |
parent | 49dab3ebfb377e1f2cd826c731c26ddc5346f520 (diff) | |
download | CMake-59285ee58ea2a02b53ca1e429ded198ee2c2fd21.zip CMake-59285ee58ea2a02b53ca1e429ded198ee2c2fd21.tar.gz CMake-59285ee58ea2a02b53ca1e429ded198ee2c2fd21.tar.bz2 |
Merge topic 'add-vs-shader-properties'
49dab3eb VS: Add VS_SHADER_OUTPUT_HEADER_FILE and VS_SHADER_VARIABLE_NAME properties.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1319
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-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 e163783..6535008 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; @@ -1766,6 +1778,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) |