[Cmake-commits] CMake branch, next, updated. v3.1.1-2414-g15bc849
Brad King
brad.king at kitware.com
Wed Jan 28 09:30:13 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 15bc8492469ca587ad24840f73eeb094a779bd9c (commit)
via 4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 (commit)
from 9bae20cd9565fa3f5b2197d20316d79239f14848 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15bc8492469ca587ad24840f73eeb094a779bd9c
commit 15bc8492469ca587ad24840f73eeb094a779bd9c
Merge: 9bae20c 4775c90
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 28 09:30:12 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 28 09:30:12 2015 -0500
Merge topic 'vs-shader-flags' into next
4775c901 VS: Add source file property to set extra hlsl shader flags
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925
commit 4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925
Author: Robert Goulet <robert.goulet at autodesk.com>
AuthorDate: Mon Jan 26 14:16:42 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 28 09:29:50 2015 -0500
VS: Add source file property to set extra hlsl shader flags
Create a VS_SHADER_FLAGS source file property so that we can set all
other Visual Studio .hlsl shader file compilation flags.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 68954c5..25f989f 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -294,6 +294,7 @@ Properties on Source Files
/prop_sf/VS_DEPLOYMENT_CONTENT
/prop_sf/VS_DEPLOYMENT_LOCATION
/prop_sf/VS_SHADER_ENTRYPOINT
+ /prop_sf/VS_SHADER_FLAGS
/prop_sf/VS_SHADER_MODEL
/prop_sf/VS_SHADER_TYPE
/prop_sf/WRAP_EXCLUDE
diff --git a/Help/prop_sf/VS_SHADER_FLAGS.rst b/Help/prop_sf/VS_SHADER_FLAGS.rst
new file mode 100644
index 0000000..0901123
--- /dev/null
+++ b/Help/prop_sf/VS_SHADER_FLAGS.rst
@@ -0,0 +1,4 @@
+VS_SHADER_FLAGS
+---------------
+
+Set additional VS shader flags of a ``.hlsl`` source file.
diff --git a/Help/release/dev/vs-shader-flags.rst b/Help/release/dev/vs-shader-flags.rst
new file mode 100644
index 0000000..0d3f6cc
--- /dev/null
+++ b/Help/release/dev/vs-shader-flags.rst
@@ -0,0 +1,5 @@
+vs-shader-flags
+---------------
+
+* A :prop_sf:`VS_SHADER_FLAGS` source file property was added to specify
+ additional shader flags to ``.hlsl`` files, for the Visual Studio generators.
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";
}
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 7227fcc..8357d5f 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -110,10 +110,12 @@ set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
+set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"")
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS)
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
+set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"")
source_group("Source Files" FILES ${SOURCE_FILES})
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
index 6796da1..b2fe7be 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
+++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
@@ -1,3 +1,7 @@
+#if !defined(FLAGS_ADDED)
+# error FLAGS_ADDED not defined
+#endif
+
struct PixelShaderInput
{
float4 pos : SV_POSITION;
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
index 0963060..3f9a4eb 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
+++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
@@ -1,3 +1,7 @@
+#if !defined(FLAGS_ADDED)
+# error FLAGS_ADDED not defined
+#endif
+
cbuffer ModelViewProjectionConstantBuffer : register(b0)
{
matrix model;
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list