From 617f9bf73d5431bc209574e15577309275bc9aba Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Sat, 6 Dec 2025 16:13:21 +0100 Subject: integrate vulkan backend into test_linux.sh --- tests/CMakeLists.txt | 4 ++- tests/CMakePresets.json | 45 ++++++++++++++++++++++++++++++++++ tests/analyze_linux.sh | 1 + tests/functional/force_dummy_backend.h | 3 +++ tests/test_linux.sh | 2 ++ 5 files changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7ba984cf..084900cd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 11) # SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU, SOKOL_DUMMY set(SOKOL_BACKEND "SOKOL_DUMMY_BACKEND" CACHE STRING "Select 3D backend API") -set_property(CACHE SOKOL_BACKEND PROPERTY STRINGS SOKOL_GLCORE SOKOL_METAL SOKOL_D3D11 SOKOL_DUMMY_BACKEND) +set_property(CACHE SOKOL_BACKEND PROPERTY STRINGS SOKOL_GLCORE SOKOL_METAL SOKOL_D3D11 SOKOL_VULKAN SOKOL_DUMMY_BACKEND) option(SOKOL_FORCE_EGL "Force EGL with GLCORE backend" OFF) option(USE_ARC "Enable/disable ARC" OFF) option(USE_ANALYZER "Enable/disable clang analyzer" OFF) @@ -98,6 +98,8 @@ elseif (LINUX) find_package(Threads REQUIRED) if ((SOKOL_BACKEND STREQUAL SOKOL_GLES3) OR SOKOL_FORCE_EGL) set(system_libs ${system_libs} X11 Xi Xcursor EGL GL asound dl m Threads::Threads) + elseif (SOKOL_BACKEND STREQUAL SOKOL_VULKAN) + set(system_libs ${system_libs} X11 Xi Xcursor vulkan asound dl m Threads::Threads) else() set(system_libs ${system_libs} X11 Xi Xcursor GL asound dl m Threads::Threads) endif() diff --git a/tests/CMakePresets.json b/tests/CMakePresets.json index 8f05b73d..d8a41850 100644 --- a/tests/CMakePresets.json +++ b/tests/CMakePresets.json @@ -311,6 +311,39 @@ "CMAKE_CXX_COMPILER": "clang++" } }, + { + "name": "linux_vulkan_debug", + "generator": "Ninja", + "binaryDir": "build/linux_vulkan_debug", + "cacheVariables": { + "SOKOL_BACKEND": "SOKOL_VULKAN", + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux_vulkan_release", + "generator": "Ninja", + "binaryDir": "build/linux_vulkan_release", + "cacheVariables": { + "SOKOL_BACKEND": "SOKOL_VULKAN", + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux_vulkan_analyze", + "generator": "Ninja", + "binaryDir": "build/linux_vulkan_analyze", + "cacheVariables": { + "SOKOL_BACKEND": "SOKOL_VULKAN", + "CMAKE_BUILD_TYPE": "Debug", + "USE_ANALYZER": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++" + } + }, { "name": "linux_gles3_debug", "generator": "Ninja", @@ -604,6 +637,18 @@ "name": "linux_gl_analyze", "configurePreset": "linux_gl_analyze" }, + { + "name": "linux_vulkan_debug", + "configurePreset": "linux_vulkan_debug" + }, + { + "name": "linux_vulkan_release", + "configurePreset": "linux_vulkan_release" + }, + { + "name": "linux_vulkan_analyze", + "configurePreset": "linux_vulkan_analyze" + }, { "name": "linux_gles3_debug", "configurePreset": "linux_gles3_debug" diff --git a/tests/analyze_linux.sh b/tests/analyze_linux.sh index 87099b9e..afb70daf 100755 --- a/tests/analyze_linux.sh +++ b/tests/analyze_linux.sh @@ -3,4 +3,5 @@ set -e source test_common.sh build linux_gl_analyze linux_gl_analyze +build linux_vulkan_analyze linux_vulkan_analyze build linux_gles3_analyze linux_gles3_analyze diff --git a/tests/functional/force_dummy_backend.h b/tests/functional/force_dummy_backend.h index ac1b6739..a2e011ec 100644 --- a/tests/functional/force_dummy_backend.h +++ b/tests/functional/force_dummy_backend.h @@ -13,6 +13,9 @@ #if defined(SOKOL_WGPU) #undef SOKOL_WGPU #endif +#if defined(SOKOL_VULKAN) +#undef SOKOL_VULKAN +#endif #ifndef SOKOL_DUMMY_BACKEND #define SOKOL_DUMMY_BACKEND #endif diff --git a/tests/test_linux.sh b/tests/test_linux.sh index ae35e8d7..8587cb2c 100755 --- a/tests/test_linux.sh +++ b/tests/test_linux.sh @@ -3,6 +3,8 @@ set -e source test_common.sh build linux_gl_debug linux_gl_debug build linux_gl_release linux_gl_release +build linux_vulkan_debug linux_vulkan_debug +build linux_vulkan_release linux_vulkan_release build linux_gles3_debug linux_gles3_debug build linux_gles3_release linux_gles3_release build linux_gl_egl_debug linux_gl_egl_debug -- cgit v1.2.3