Skip to content

Commit

Permalink
[BREAKING] Build sdl3 by default for audio
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Aug 16, 2024
1 parent eea1619 commit fbbad5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,22 @@ 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)
include(ext/snmalloc.cmake)
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()

Expand Down
4 changes: 4 additions & 0 deletions ext/sdl3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fbbad5b

Please sign in to comment.