From dfa74c2f985577067dbc12ac3b5f5e6419e56103 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 28 Apr 2024 09:56:12 +0200 Subject: [PATCH] Check vulkan version --- CMakeLists.txt | 9 ++++++--- client/CMakeLists.txt | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e517643..4db6ed9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ endif() set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD 20) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # Default to PIC code include(CheckPIESupported) @@ -53,7 +54,7 @@ endif() find_package(PkgConfig REQUIRED) find_package(Vulkan REQUIRED) find_package(Git) - +include(VulkanVersion) if (WIVRN_USE_SYSTEM_BOOST STREQUAL "AUTO") if(WIVRN_BUILD_DISSECTOR) @@ -70,6 +71,10 @@ elseif(WIVRN_USE_SYSTEM_BOOST STREQUAL "ON") endif() if (WIVRN_BUILD_SERVER) + if (Vulkan_VERSION VERSION_LESS "1.3.261") + message(FATAL_ERROR "Vulkan version must be at least 1.3.261, found ${Vulkan_VERSION}") + endif() + if (NOT WIVRN_USE_NVENC AND NOT WIVRN_USE_VAAPI AND NOT WIVRN_USE_X264) message(FATAL_ERROR "No encoder selected, use at least one of WIVRN_USE_NVENC, WIVRN_USE_VAAPI or WIVRN_USE_X264") endif() @@ -146,8 +151,6 @@ if (WIVRN_BUILD_CLIENT AND NOT ANDROID) endif() endif() -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - if(ANDROID) set(ANDROID_NDK $ENV{ANDROID_NDK_ROOT}) set(CMAKE_ANDROID_NDK $ENV{ANDROID_NDK_ROOT}) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index d3eb79bd..6147b946 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -9,7 +9,6 @@ FetchContent_MakeAvailable(spdlog glm fastgltf imgui stb libktx implot) include(FreetypeHarfbuzz) include(CompileGLSL) -include(VulkanVersion) add_library(stb INTERFACE) target_include_directories(stb INTERFACE ${stb_SOURCE_DIR})