summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-29 18:48:20 (GMT)
committerBrad King <brad.king@kitware.com>2014-08-12 14:08:49 (GMT)
commit6fe770e163daf005cd151798c18b89ad50c17125 (patch)
tree4cfb88a28414b51522dc769506b21e139ef54c11 /Source/cmVisualStudio10TargetGenerator.cxx
parent9b4dc2ad4a82b233520015fdc5cbf5df1ed540f7 (diff)
downloadCMake-6fe770e163daf005cd151798c18b89ad50c17125.zip
CMake-6fe770e163daf005cd151798c18b89ad50c17125.tar.gz
CMake-6fe770e163daf005cd151798c18b89ad50c17125.tar.bz2
VS: Add a source file property to set the hlsl shader type
Create a VS_SHADER_TYPE source file property. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 01a3b37..6989c51 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1020,11 +1020,22 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
{
bool toolHasSettings = false;
std::string tool = "None";
+ std::string shaderType;
std::string const& ext = sf->GetExtension();
if(ext == "appxmanifest")
{
tool = "AppxManifest";
}
+ else if(ext == "hlsl")
+ {
+ tool = "FXCompile";
+ // Figure out the type of shader compiler to use.
+ if(const char* st = sf->GetProperty("VS_SHADER_TYPE"))
+ {
+ shaderType = st;
+ toolHasSettings = true;
+ }
+ }
else if(ext == "jpg" ||
ext == "png")
{
@@ -1078,6 +1089,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
}
}
}
+ if(!shaderType.empty())
+ {
+ this->WriteString("<ShaderType>", 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
+ << "</ShaderType>\n";
+ }
this->WriteString("</", 2);
(*this->BuildFileStream) << tool << ">\n";