From 8d1ccbc693398b3ac67aa6f0cf222c6ed78fc9b8 Mon Sep 17 00:00:00 2001 From: Jeremiah van Oosten Date: Mon, 23 Apr 2018 15:04:10 +0200 Subject: VS: Add VS_SHADER_OBJECT_FILE_NAME source file property --- Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst | 6 ++++++ Help/release/dev/vs-hlsl-object-name.rst | 6 ++++++ Source/cmVisualStudio10TargetGenerator.cxx | 8 ++++++++ 4 files changed, 21 insertions(+) create mode 100644 Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst create mode 100644 Help/release/dev/vs-hlsl-object-name.rst diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index d141479..b3e2fec 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -405,6 +405,7 @@ Properties on Source Files /prop_sf/VS_SHADER_ENTRYPOINT /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL + /prop_sf/VS_SHADER_OBJECT_FILE_NAME /prop_sf/VS_SHADER_OUTPUT_HEADER_FILE /prop_sf/VS_SHADER_TYPE /prop_sf/VS_SHADER_VARIABLE_NAME diff --git a/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst new file mode 100644 index 0000000..093bcc6 --- /dev/null +++ b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst @@ -0,0 +1,6 @@ +VS_SHADER_OBJECT_FILE_NAME +-------------------------- + +Specifies a file name for the compiled shader object file for an ``.hlsl`` +source file. This adds the ``-Fo`` flag to the command line for the FxCompiler +tool. diff --git a/Help/release/dev/vs-hlsl-object-name.rst b/Help/release/dev/vs-hlsl-object-name.rst new file mode 100644 index 0000000..625e5ee --- /dev/null +++ b/Help/release/dev/vs-hlsl-object-name.rst @@ -0,0 +1,6 @@ +vs-hlsl-object-name +------------------- + +* HLSL source file property :prop_sf:`VS_SHADER_OBJECT_FILE_NAME` has been + added to the :ref:`Visual Studio Generators` for VS 2010 and above. + The property specifies the file name of the compiled shader object. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b56104e..1a618a0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1590,6 +1590,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) std::string shaderAdditionalFlags; std::string shaderDisableOptimizations; std::string shaderEnableDebug; + std::string shaderObjectFileName; std::string outputHeaderFile; std::string variableName; std::string settingsGenerator; @@ -1666,6 +1667,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) shaderDisableOptimizations = cmSystemTools::IsOn(sdo) ? "true" : "false"; toolHasSettings = true; } + if (const char* sofn = sf->GetProperty("VS_SHADER_OBJECT_FILE_NAME")) { + shaderObjectFileName = sofn; + toolHasSettings = true; + } } else if (ext == "jpg" || ext == "png") { tool = "Image"; } else if (ext == "resw") { @@ -1808,6 +1813,9 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) this->WriteElemEscapeXML("DisableOptimizations", shaderDisableOptimizations, 3); } + if (!shaderObjectFileName.empty()) { + this->WriteElemEscapeXML("ObjectFileOutput", shaderObjectFileName, 3); + } if (!shaderAdditionalFlags.empty()) { this->WriteElemEscapeXML("AdditionalOptions", shaderAdditionalFlags, 3); } -- cgit v0.12