Skip to content

Commit 0709990

Browse files
authored
build(deps): Add SUNSHINE_SYSTEM_VULKAN_HEADERS option (#5103)
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
1 parent dfffc8a commit 0709990

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cmake/compile_definitions/linux.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,14 @@ endif()
122122

123123
# vulkan video encoding (via FFmpeg)
124124
if(${SUNSHINE_ENABLE_VULKAN})
125-
# use Vulkan headers from build-deps submodule (system headers may be too old, e.g. Ubuntu 22.04)
126-
set(VULKAN_HEADERS_DIR "${CMAKE_SOURCE_DIR}/third-party/build-deps/third-party/FFmpeg/Vulkan-Headers/include")
125+
if(NOT SUNSHINE_SYSTEM_VULKAN_HEADERS)
126+
# use Vulkan headers from build-deps submodule (system headers may be too old, e.g. Ubuntu 22.04)
127+
set(VULKAN_HEADERS_DIR "${CMAKE_SOURCE_DIR}/third-party/build-deps/third-party/FFmpeg/Vulkan-Headers/include")
128+
else()
129+
find_package(VulkanHeaders REQUIRED)
130+
get_target_property(VULKAN_HEADERS_DIR Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES)
131+
endif()
132+
127133
if(NOT EXISTS "${VULKAN_HEADERS_DIR}/vulkan/vulkan.h")
128134
message(FATAL_ERROR "Vulkan headers not found in build-deps submodule")
129135
endif()

cmake/prep/options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
1818

1919
option(SUNSHINE_ENABLE_TRAY "Enable system tray icon." ON)
2020

21+
option(SUNSHINE_SYSTEM_VULKAN_HEADERS "Use system installation of vulkan-headers rather than the submodule." OFF)
2122
option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF)
2223

2324
if(APPLE)

0 commit comments

Comments
 (0)