Allows building gzdoom with Vulkan with either X11 or Wayland WSI integration through CMake options

This commit is contained in:
Romain Tisserand 2023-09-07 15:35:33 +02:00 committed by Rachael Alexanderson
parent de770faeb1
commit 06f13006ca
2 changed files with 15 additions and 0 deletions

View file

@ -1,6 +1,17 @@
cmake_minimum_required(VERSION 3.15)
project(zvulkan)
option( VULKAN_USE_XLIB "Use Vulkan xlib (X11) WSI integration" ON )
option( VULKAN_USE_WAYLAND "Use Vulkan Wayland WSI integration" OFF )
if ( VULKAN_USE_XLIB )
add_definitions( -DVULKAN_USE_XLIB=1 )
else()
if (VULKAN_USE_WAYLAND)
add_definitions( -DVULKAN_USE_WAYLAND=1 )
endif()
endif()
set(ZVULKAN_SOURCES
src/vulkanbuilders.cpp
src/vulkandevice.cpp

View file

@ -5,7 +5,11 @@
#define VK_USE_PLATFORM_MACOS_MVK
#define VK_USE_PLATFORM_METAL_EXT
#else
#if defined(VULKAN_USE_XLIB)
#define VK_USE_PLATFORM_XLIB_KHR
#elif defined(VULKAN_USE_WAYLAND)
#define VK_USE_PLATFORM_WAYLAND_KHR
#endif
#endif
/* This file is part of volk library; see volk.h for version/license details */