diff --git a/lib/vulkan.cmake b/lib/vulkan.cmake index 2e705d27ea2..6d451cafa83 100644 --- a/lib/vulkan.cmake +++ b/lib/vulkan.cmake @@ -93,8 +93,6 @@ endif () option(VULKAN_USE_PRECOMPILED "Force use of precompiled versions of Vulkan-Loader and Shaderc." OFF) -get_prebuilt_path(PREBUILT_PATH) - set(USING_PREBUILT_VULKAN ${VULKAN_USE_PRECOMPILED}) if(PLATFORM_WINDOWS OR PLATFORM_MAC) @@ -103,6 +101,10 @@ elseif(PLATFORM_LINUX AND FSO_BUILD_APPIMAGE) set(USING_PREBUILT_VULKAN TRUE) endif() +if(USING_PREBUILT_VULKAN) + get_prebuilt_path(PREBUILT_PATH) +endif() + # Shaderc - runtime compilation of glsl to SPIRV # # This is dynamically loaded, so we don't have to link against it. That also @@ -154,15 +156,15 @@ endif() # Vulkan/Shaderc headers # -# Use prebuilt if we should, or just as a fallback if the SDK isn't installed. +# Use prebuilt if we should, otherwise require that the headers/loader be available. # The find_package() min version should be what is used in the prebuilt repo. # Note that we only rely on the headers and do NOT link against the Vulkan libs! if(NOT USING_PREBUILT_VULKAN) - find_package(Vulkan 1.4.341) + find_package(Vulkan 1.4.341 REQUIRED) endif() -# prebuilt/fallback +# prebuilt if(NOT TARGET Vulkan::Headers) add_library(VulkanHeaders INTERFACE)