KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.23k stars 634 forks source link

CMakeLists.txt logic for finding dxc has deficiencies #1081

Closed SRSaunders closed 1 month ago

SRSaunders commented 2 months ago

Two issues found with the CMakeLists logic for finding dxc:

  1. 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.
  2. 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.