Two issues found with the CMakeLists logic for finding dxc:
project(vulkan_samples) is called after find_package(Vulkan) which is incorrect. This results in default platform search paths not being set up properly for find_package() and dxc is not found unless VULKAN_SDK is defined ahead of time in the shell. This is awkward and unnecessary on Windows, and does not support system-wide installations on macOS and linux.
The test for Vulkan_dxc_EXECUTABLE should be if(Vulkan_dxc_EXECUTABLE) and not if(DEFINED Vulkan_dxc_EXECUTABLE). The latter test erroneously passes even if Vulkan_dxc_EXECUTABLE-NOTFOUND is the result from find_package() or find_program().
I will submit a fix that corrects these as part of larger PR.
Two issues found with the CMakeLists logic for finding dxc:
project(vulkan_samples)
is called afterfind_package(Vulkan)
which is incorrect. This results in default platform search paths not being set up properly forfind_package()
and dxc is not found unlessVULKAN_SDK
is defined ahead of time in the shell. This is awkward and unnecessary on Windows, and does not support system-wide installations on macOS and linux.Vulkan_dxc_EXECUTABLE
should beif(Vulkan_dxc_EXECUTABLE)
and notif(DEFINED Vulkan_dxc_EXECUTABLE)
. The latter test erroneously passes even ifVulkan_dxc_EXECUTABLE-NOTFOUND
is the result fromfind_package()
orfind_program()
.I will submit a fix that corrects these as part of larger PR.