FindVulkan.cmake can't find DXC debug libraries while present, as it's not looking for them.

Hi,

Some preliminary info: I am currently developing a Vulkan pet project using Vulkan SDK 1.3.268 (I did check - this SDK does include the debug libs and the debug libs are present in my installed SDK), using cmake version 3.28. I am also using findVulkan.cmake to include the vulkan sdk into my project as follows:

set(VULKAN_COMPONENTS
	"glslc"
	"glslangValidator"
	"glslang"
	"shaderc_combined"
	"SPIRV-Tools"
	"dxc"
)

#Add Vulkan
find_package(Vulkan REQUIRED COMPONENTS ${VULKAN_COMPONENTS})
if(NOT Vulkan_FOUND)
	message(FATAL_ERROR "Vulkan SDK could not be found, make sure that the SDK is installed!")
else()
	message(STATUS "Vulkan: Version ${Vulkan_VERSION}")
endif()

This always worked until I added the optional dxc component, which immediately threw a warning that it couldn’t find the debug libs for dxc, which could potentially lead to ABI differences between the release and debug configs. My investigation led me to the source code of findVulkan.cmake, in which I noticed that the file is not trying to look for it at all. After a bit of pondering I resolved this through inserting the following on line 474 of findVulkan.cmake.:

  find_library(Vulkan_dxc_DEBUG_LIBRARY
		  NAMES dxcompilerd
		  HINTS
		    ${_Vulkan_hint_library_search_paths})
  mark_as_advanced(Vulkan_dxc_DEBUG_LIBRARY)

Could someone confirm this behaviour?

As of Vulkan SDK 1.3.268 Debug versions of the DXC and VOLK libraries have been included in the SDK (dxcompilerd.dll, dxcompilerd.lib, volkd.lib).

See the release notes here:
https://vulkan.lunarg.com/doc/sdk/1.3.268.0/windows/release_notes.html

This will require fixes to FindVulkan.cmake

I have opened an issue to track this.

1 Like