diff options
Diffstat (limited to 'Tests/FindVulkan/Test/Run-dxc_exe.cmake')
-rw-r--r-- | Tests/FindVulkan/Test/Run-dxc_exe.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/FindVulkan/Test/Run-dxc_exe.cmake b/Tests/FindVulkan/Test/Run-dxc_exe.cmake new file mode 100644 index 0000000..0d38855 --- /dev/null +++ b/Tests/FindVulkan/Test/Run-dxc_exe.cmake @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.12) + +function(run_dxc_exe exe exe_display) + execute_process(COMMAND ${exe} --help + OUTPUT_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE result + ) + + if(NOT result EQUAL 0) + message(SEND_ERROR "Result of ${exe_display} --help is ${result}, should be 0") + endif() + + if(NOT output MATCHES "^OVERVIEW: HLSL Compiler for ") + message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"OVERVIEW: HLSL Compiler for \"") + endif() +endfunction() + +run_dxc_exe("${VULKAN_DXC_EXECUTABLE}" "\${VULKAN_DXC_EXECUTABLE}") +run_dxc_exe("${VULKAN_DXC_EXECUTABLE_TARGET}" "Vulkan::dxc_exe") |