Building SDL on macOS without Vulkan or OpenGL still requires library-specific files

Hi there,

I was under the impression that Vulkan is another rendering backend, similar to Metal or OpenGL, that is not a requirement for SDL2, but for which support may be built in by setting the right #defines. However, src/video/SDL_sysvideo.h has an unguarded include for SDL_vulkan_internal.h, which, regardless of the value of SDK_VIDEO_VULKAN, includes SDL_vulkan.h

I’m sure it can’t be the case that Vulkan is required to build SDL, as that would prevent it from building on many of the platforms it supports configuration for building. However, this also extends into src/video/cocoa/SDL_cocoavideo.m, where an include to SDL_cocoavulkan.h is unguarded, which requires the inclusion of SDL_cocoavulkan.m, and an available Vulkan API to build against. Similarly for several OpenGL files whose inclusion seems to be mandatory regardless of which configuration options are defined.

Am I badly misreading what code gets included based on conditional macros? Or is it not possible to build SDL on macOS without the following files:

src/video/SDL_vulkan_internal.h
src/video/cocoa/SDL_cocoaopengl.h
src/video/cocoa/SDL_cocoaopengles.h
src/video/cocoa/SDL_cocoavulkan.h
src/video/cocoa/SDL_cocoaopengl.m
src/video/cocoa/SDL_cocoavulkan.m
src/video/cocoa/SDL_cocoaopengles.m
src/video/khronos/vulkan/vk_platform.h
src/video/khronos/vulkan/vulkan.h
include/SDL_opengl_glext.h
include/SDL_opengl.h
include/SDL_vulkan.h

Thanks!

Those are just to make it possible for SDL to use Vulkan on macOS (via MoltenVK).

Vulkan is not, however, an available backend for SDL Renderer (though you can use SDL to set up a window and then do your own rendering with Vulkan).

Anyway, why are you trying to build SDL without Vulkan or OpenGL support? It’s not like SDL is pulling in the Vulkan SDK or something.