From b6eec4ad64ca11112d364c3fab751bcd9dea1c1e Mon Sep 17 00:00:00 2001 From: Jon Spencer Date: Tue, 26 Feb 2019 11:08:53 -0800 Subject: [PATCH] [sdl2] allow sdl2 vulkan support (#5374) * [sdl2] allow sdl2 vulkan support * turn sdl2 vulkan support into a feature --- ports/sdl2/CONTROL | 4 ++++ ports/sdl2/portfile.cmake | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index 18e867b7c6..05e9d6363d 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,3 +1,7 @@ Source: sdl2 Version: 2.0.9-1 Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. + +Feature: vulkan +Description: Vulkan functionality for SDL +Build-Depends: vulkan diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 4bcfa5a9af..294d374496 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -16,13 +16,18 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT) +set(VULKAN_VIDEO OFF) +if("vulkan" IN_LIST FEATURES) + set(VULKAN_VIDEO ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DSDL_STATIC=${SDL_STATIC} -DSDL_SHARED=${SDL_SHARED} - -DVIDEO_VULKAN=OFF + -DVIDEO_VULKAN=${VULKAN_VIDEO} -DFORCE_STATIC_VCRT=${FORCE_STATIC_VCRT} -DLIBC=ON )