summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-29 14:13:58 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-29 14:13:58 (GMT)
commit98659aecfd819eb1e7771f7420933316a628b057 (patch)
tree5c5fe154a326b9e8755b1dbf145a82ec7ca25f74 /Source
parent983a98e5b8118ff5063400d8ffac7a511ca8002a (diff)
parent4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 (diff)
downloadCMake-98659aecfd819eb1e7771f7420933316a628b057.zip
CMake-98659aecfd819eb1e7771f7420933316a628b057.tar.gz
CMake-98659aecfd819eb1e7771f7420933316a628b057.tar.bz2
Merge topic 'vs-shader-flags'
4775c901 VS: Add source file property to set extra hlsl shader flags
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b265c0e..d2f6ffd 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1211,6 +1211,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
std::string shaderType;
std::string shaderEntryPoint;
std::string shaderModel;
+ std::string shaderAdditionalFlags;
std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
if(ext == "hlsl")
{
@@ -1233,6 +1234,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
shaderModel = sm;
toolHasSettings = true;
}
+ // Figure out if there's any additional flags to use
+ if (const char* saf = sf->GetProperty("VS_SHADER_FLAGS"))
+ {
+ shaderAdditionalFlags = saf;
+ toolHasSettings = true;
+ }
}
else if(ext == "jpg" ||
ext == "png")
@@ -1342,6 +1349,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
(*this->BuildFileStream) << cmVS10EscapeXML(shaderModel)
<< "</ShaderModel>\n";
}
+ if(!shaderAdditionalFlags.empty())
+ {
+ this->WriteString("<AdditionalOptions>", 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(shaderAdditionalFlags)
+ << "</AdditionalOptions>\n";
+ }
this->WriteString("</", 2);
(*this->BuildFileStream) << tool << ">\n";
}