more conform vulkan/metal configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9689ac..5e0895e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1152,17 +1152,19 @@ if(ANDROID)
list(APPEND EXTRA_LIBS ${OpenGLES1_LIBRARY} ${OpenGLES2_LIBRARY})
endif()
- CHECK_C_SOURCE_COMPILES("
- #if defined(__ARM_ARCH) && __ARM_ARCH < 7
- #error Vulkan doesn't work on this configuration
- #endif
- int main(void) {
- return 0;
- }
- " VULKAN_PASSED_ANDROID_CHECKS)
- if(NOT VULKAN_PASSED_ANDROID_CHECKS)
- set(SDL_VULKAN OFF)
- message(STATUS "Vulkan doesn't work on this configuration")
+ if(SDL_VULKAN)
+ CHECK_C_SOURCE_COMPILES("
+ #if defined(__ARM_ARCH) && __ARM_ARCH < 7
+ #error Vulkan doesn't work on this configuration
+ #endif
+ int main(void) {
+ return 0;
+ }
+ " VULKAN_PASSED_ANDROID_CHECKS)
+ if(VULKAN_PASSED_ANDROID_CHECKS)
+ set(SDL_VIDEO_VULKAN 1)
+ set(HAVE_VULKAN TRUE)
+ endif()
endif()
endif()
@@ -1277,6 +1279,11 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS AND NOT HAIKU)
CheckOpenGLES()
CheckWayland()
CheckVivante()
+ # FIXME: implement CheckVulkan()
+ if(SDL_VULKAN)
+ set(SDL_VIDEO_VULKAN 1)
+ set(HAVE_VULKAN TRUE)
+ endif()
endif()
if(UNIX)
@@ -1749,6 +1756,11 @@ elseif(WINDOWS)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
set(HAVE_OPENGLES TRUE)
endif()
+
+ if(SDL_VULKAN)
+ set(SDL_VIDEO_VULKAN 1)
+ set(HAVE_VULKAN TRUE)
+ endif()
endif()
if(SDL_HIDAPI)
@@ -2014,24 +2026,22 @@ elseif(APPLE)
if(HAVE_FRAMEWORK_METAL)
set(SDL_FRAMEWORK_METAL 1)
set(SDL_FRAMEWORK_QUARTZCORE 1)
- else()
- set(SDL_VULKAN 0)
- set(SDL_METAL 0)
- set(SDL_RENDER_METAL 0)
+ if(SDL_VULKAN)
+ set(SDL_VIDEO_VULKAN 1)
+ set(HAVE_VULKAN TRUE)
+ endif()
+ if(SDL_METAL)
+ set(SDL_VIDEO_METAL 1)
+ set(HAVE_METAL TRUE)
+ endif()
+ if(SDL_RENDER_METAL)
+ file(GLOB RENDER_METAL_SOURCES ${SDL2_SOURCE_DIR}/src/render/metal/*.m)
+ set(SOURCE_FILES ${SOURCE_FILES} ${RENDER_METAL_SOURCES})
+ set(SDL_VIDEO_RENDER_METAL 1)
+ set(HAVE_RENDER_METAL TRUE)
+ endif()
endif()
endif()
-
- if(SDL_METAL)
- set(SDL_VIDEO_METAL 1)
- set(HAVE_METAL TRUE)
- endif()
-
- if(SDL_RENDER_METAL)
- file(GLOB RENDER_METAL_SOURCES ${SDL2_SOURCE_DIR}/src/render/metal/*.m)
- set(SOURCE_FILES ${SOURCE_FILES} ${RENDER_METAL_SOURCES})
- set(SDL_VIDEO_RENDER_METAL 1)
- set(HAVE_RENDER_METAL TRUE)
- endif()
endif()
# Actually load the frameworks at the end so we don't duplicate include.
@@ -2521,14 +2531,10 @@ elseif(OS2)
endif()
endif()
-if(SDL_VULKAN AND NOT SDL_LOADSO)
+if(HAVE_VULKAN AND NOT SDL_LOADSO)
message(STATUS "Vulkan support is available, but disabled because there's no loadso.")
- set(SDL_VULKAN OFF)
-endif()
-
-if(SDL_VULKAN)
- set(SDL_VIDEO_VULKAN 1)
- set(HAVE_VULKAN TRUE)
+ set(HAVE_VULKAN FALSE)
+ set(SDL_VIDEO_VULKAN 0)
endif()
# Dummies