diff options
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_sf/VS_SHADER_FLAGS.rst | 4 | ||||
-rw-r--r-- | Help/release/dev/vs-shader-flags.rst | 5 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildHandler.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 8 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 13 | ||||
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/CustomCommand/foo.in | 5 | ||||
-rw-r--r-- | Tests/CustomCommand/subdir.h.in | 1 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl | 4 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl | 4 |
14 files changed, 71 insertions, 3 deletions
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/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5db595c..ef49c4b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 1) -set(CMake_VERSION_PATCH 20150128) +set(CMake_VERSION_PATCH 20150129) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 8f087ab..f941408 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -67,13 +67,13 @@ static const char* cmCTestErrorMatches[] = { "^CMake Error.*:", ":[ \\t]cannot find", ":[ \\t]can't find", - ": \\*\\*\\* No rule to make target \\`.*\\'. Stop", + ": \\*\\*\\* No rule to make target \\[`'].*\\'. Stop", ": \\*\\*\\* No targets specified and no makefile found", ": Invalid loader fixup for symbol", ": Invalid fixups exist", ": Can't find library for", ": internal link edit command failed", - ": Unrecognized option \\`.*\\'", + ": Unrecognized option \\[`'].*\\'", "\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([^WI]\\)", "ld: 0706-006 Cannot find or open library file: -l ", "ild: \\(argument error\\) can't find library argument ::", diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8d18c3a..a4f099b 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -663,6 +663,14 @@ void cmTargetTraceDependencies::Trace() { std::vector<std::string> objDeps; cmSystemTools::ExpandListArgument(additionalDeps, objDeps); + for(std::vector<std::string>::iterator odi = objDeps.begin(); + odi != objDeps.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } this->FollowNames(objDeps); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 67824c6..ff41f6d 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -605,6 +605,14 @@ cmNinjaTargetGenerator if(const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) { std::vector<std::string> depList; cmSystemTools::ExpandListArgument(objectDeps, depList); + for(std::vector<std::string>::iterator odi = depList.begin(); + odi != depList.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } std::transform(depList.begin(), depList.end(), std::back_inserter(implicitDeps), MapToNinjaPath()); } 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/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 57ffeec..268069d 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -154,6 +154,19 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c ${PROJECT_BINARY_DIR}/foo.c ) +# Test using OBJECT_DEPENDS to bring in a custom command. +# Use a path that can be simplified to make sure paths +# are consistently normalized. +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ${CMAKE_CURRENT_BINARY_DIR}/subdir/subdir.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ) +set_property(SOURCE ${PROJECT_BINARY_DIR}/foo.c PROPERTY + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h) + # Add custom command to generate not_included.h, which is a header # file that is not included by any source in this project. This will # test whether all custom command outputs explicitly listed as sources diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index e43aed1..15d2d2c 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -6,6 +6,11 @@ int generated(); int wrapped(); +#include "subdir/subdir.h" +#ifndef SUBDIR_DEF +# error SUBDIR_DEF not defined +#endif + int main () { if (generated()*wrapped()*doc() == 3*5*7) diff --git a/Tests/CustomCommand/subdir.h.in b/Tests/CustomCommand/subdir.h.in new file mode 100644 index 0000000..1e50750 --- /dev/null +++ b/Tests/CustomCommand/subdir.h.in @@ -0,0 +1 @@ +#define SUBDIR_DEF 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; |