diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index 7079f9e90..ccfb8d7ae 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -122,8 +122,14 @@ endif() # vulkan video encoding (via FFmpeg) if(${SUNSHINE_ENABLE_VULKAN}) - # use Vulkan headers from build-deps submodule (system headers may be too old, e.g. Ubuntu 22.04) - set(VULKAN_HEADERS_DIR "${CMAKE_SOURCE_DIR}/third-party/build-deps/third-party/FFmpeg/Vulkan-Headers/include") + if(NOT SUNSHINE_SYSTEM_VULKAN_HEADERS) + # use Vulkan headers from build-deps submodule (system headers may be too old, e.g. Ubuntu 22.04) + set(VULKAN_HEADERS_DIR "${CMAKE_SOURCE_DIR}/third-party/build-deps/third-party/FFmpeg/Vulkan-Headers/include") + else() + find_package(VulkanHeaders REQUIRED) + get_target_property(VULKAN_HEADERS_DIR Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES) + endif() + if(NOT EXISTS "${VULKAN_HEADERS_DIR}/vulkan/vulkan.h") message(FATAL_ERROR "Vulkan headers not found in build-deps submodule") endif() diff --git a/cmake/prep/options.cmake b/cmake/prep/options.cmake index bdc7f225c..50bca32b1 100644 --- a/cmake/prep/options.cmake +++ b/cmake/prep/options.cmake @@ -18,6 +18,7 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF) option(SUNSHINE_ENABLE_TRAY "Enable system tray icon." ON) +option(SUNSHINE_SYSTEM_VULKAN_HEADERS "Use system installation of vulkan-headers rather than the submodule." OFF) option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF) if(APPLE)