Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/vulkan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Loading