FindVulkan: No cross compiling support for include, library and binary search path with MinGW
The cmake support file FindVulkan.cmake
for finding Vulkan currently supports library and executable file paths on Windows only for the Lunar Vulkan SDK on native Windows, see https://gitlab.kitware.com/cmake/cmake/-/blob/v3.25.2/Modules/FindVulkan.cmake#L244
if(WIN32)
set(_Vulkan_library_name vulkan-1)
set(_Vulkan_hint_include_search_paths
"$ENV{VULKAN_SDK}/Include"
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_Vulkan_hint_executable_search_paths
"$ENV{VULKAN_SDK}/Bin"
)
set(_Vulkan_hint_library_search_paths
"$ENV{VULKAN_SDK}/Lib"
"$ENV{VULKAN_SDK}/Bin"
)
else()
set(_Vulkan_hint_executable_search_paths
"$ENV{VULKAN_SDK}/Bin32"
)
set(_Vulkan_hint_library_search_paths
"$ENV{VULKAN_SDK}/Lib32"
"$ENV{VULKAN_SDK}/Bin32"
)
endif()
These search paths do not work for cross compiling due to the use of upper case letters and for 32bit architecture due to the suffix 32
.
Relevant for MinGW would be the paths starting at https://gitlab.kitware.com/cmake/cmake/-/blob/v3.25.2/Modules/FindVulkan.cmake#L267
set(_Vulkan_library_name vulkan)
set(_Vulkan_hint_include_search_paths
"$ENV{VULKAN_SDK}/include"
)
set(_Vulkan_hint_executable_search_paths
"$ENV{VULKAN_SDK}/bin"
)
set(_Vulkan_hint_library_search_paths
"$ENV{VULKAN_SDK}/lib"
)
which are also used with MinGW on native Windows (see e.g. https://packages.msys2.org/package/mingw-w64-x86_64-vulkan-loader?repo=mingw64)
Edited by Brad King