Skip to content

Commit 7c7196b

Browse files
committed
meson: Use CMake to configure SDL3
1 parent 0df849f commit 7c7196b

181 files changed

Lines changed: 28 additions & 1455 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

meson.build

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,16 +1664,39 @@ endif
16641664

16651665
sdl = not_found
16661666
if not get_option('sdl').auto() or have_system
1667-
sdl = dependency('sdl3', required: get_option('sdl'),
1668-
fallback: ['sdl3', 'sdl3_dep'],
1669-
default_options: ['default_library=static'])
1667+
sdl = dependency('sdl3', required: false, allow_fallback: false)
1668+
if not sdl.found() and not get_option('sdl').disabled()
1669+
sdl3_cmake_opts = cmake.subproject_options()
1670+
sdl3_cmake_opts.add_cmake_defines({
1671+
'SDL_CAMERA': 'OFF',
1672+
'SDL_DISKAUDIO': 'OFF',
1673+
'SDL_DUMMYVIDEO': 'OFF',
1674+
'SDL_FRIBIDI': 'OFF',
1675+
'SDL_GPU': 'OFF',
1676+
'SDL_HAPTIC': 'OFF',
1677+
'SDL_LIBTHAI': 'OFF',
1678+
'SDL_POWER': 'OFF',
1679+
'SDL_RENDER': 'OFF',
1680+
'SDL_SENSOR': 'OFF',
1681+
'SDL_SHARED': 'OFF',
1682+
'SDL_STATIC': 'ON',
1683+
'SDL_TEST_LIBRARY': 'OFF',
1684+
'SDL_TRAY': 'OFF',
1685+
'SDL_VIRTUAL_JOYSTICK': 'OFF',
1686+
'SDL_X11_XTEST': 'OFF',
1687+
})
1688+
sdl3_sp = cmake.subproject('sdl3', options: sdl3_cmake_opts, required: get_option('sdl'))
1689+
if sdl3_sp.found()
1690+
sdl = sdl3_sp.dependency('SDL3-static')
1691+
meson.override_dependency('sdl3', sdl)
1692+
endif
1693+
endif
16701694
sdl_image = not_found
16711695
endif
16721696
if sdl.found()
16731697
# Some versions of SDL have problems with -Wundef
16741698
if not cc.compiles('''
16751699
#include <SDL3/SDL.h>
1676-
#include <SDL_syswm.h>
16771700
int main(int argc, char *argv[]) { return 0; }
16781701
''', dependencies: sdl.partial_dependency(compile_args: true, includes: true), args: '-Werror=undef')
16791702
sdl = declare_dependency(compile_args: '-Wno-undef',

subprojects/packagefiles/sdl3/LICENSE.build

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)