diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ad852c3..b1b86dad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ if (USE_GAMECONTROLLERDB AND BUILD_CLIENT) endif() option(USE_SNMALLOC "Use the snmalloc allocator" OFF) +option(USE_SDL3_AUDIO "Always use SDL audio" ON) if (BUILD_CLIENT) if (USE_SNMALLOC) @@ -90,13 +91,14 @@ if (BUILD_CLIENT) endif() include(game-window/BuildSettings.cmake) + if (USE_SDL3_AUDIO OR GAMEWINDOW_SYSTEM STREQUAL "SDL3") + include(ext/sdl3.cmake) + endif() if (GAMEWINDOW_SYSTEM STREQUAL "EGLUT") add_subdirectory(eglut) add_subdirectory(linux-gamepad) elseif (GAMEWINDOW_SYSTEM STREQUAL "GLFW") include(ext/glfw.cmake) - elseif (GAMEWINDOW_SYSTEM STREQUAL "SDL3") - include(ext/sdl3.cmake) endif() endif() diff --git a/ext/sdl3.cmake b/ext/sdl3.cmake index dab6a576..76e7b36b 100644 --- a/ext/sdl3.cmake +++ b/ext/sdl3.cmake @@ -5,6 +5,10 @@ if(SDL3_VENDORED) set(SDL3_VENDORED ON CACHE BOOL "" FORCE) set(SDL_SHARED OFF CACHE BOOL "" FORCE) set(SDL_STATIC ON CACHE BOOL "" FORCE) + set(SDL_CAMERA OFF CACHE BOOL "" FORCE) + set(SDL_RENDER OFF CACHE BOOL "" FORCE) + set(SDL_DIALOG OFF CACHE BOOL "" FORCE) + set(SDL_SENSOR OFF CACHE BOOL "" FORCE) add_subdirectory(sdl3 EXCLUDE_FROM_ALL) else() # 1. Look for a SDL3 package,