Skip to content

Commit 3fcf3e8

Browse files
committed
build sdl3 from source
1 parent a00451d commit 3fcf3e8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

meson.build

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ endif
192192
#### Platform Common External Libraries ####
193193
if host_machine.system() in ['linux','darwin']
194194
deps += [
195-
dependency(['sdl3']),
196-
dependency('SDL3_image'),
195+
#dependency(['sdl3']),
196+
#dependency('SDL3_image'),
197197
dependency('flac'),
198198
dependency('minizip'),
199199
dependency('threads'),
@@ -231,6 +231,15 @@ external_objects = []
231231
external_libs = []
232232
subdir('external')
233233

234+
sdl3_opt = cmake.subproject_options()
235+
sdl3_opt.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': get_option('b_staticpic'), 'BUILD_SHARED_LIBS':false, 'BUILD_STATIC_LIBS': true})
236+
sdl3_opt.append_compile_args('c','-DUSE_XINPUT2_KEYBOARD')
237+
sdl3_proj = cmake.subproject('SDL3-3.2.8', options: sdl3_opt)
238+
sdl3_dep = sdl3_proj.dependency('SDL3-static')
239+
240+
sdl3_image_proj = cmake.subproject('SDL3_image-3.2.4', options: sdl3_opt)
241+
sdl3_image_dep = sdl3_image_proj.dependency('SDL3_image-static')
242+
234243
boost_dep = declare_dependency(include_directories: include_directories('external/include/boost_1_75'))
235244
meson.override_dependency('boost-175', boost_dep)
236245
install_rpath = prefix/get_option('fmod_dir')
@@ -246,7 +255,7 @@ raknet_proj = subproject('RakNet')
246255
raknet_dep = dependency('RakNet')
247256
tracy_proj = subproject('tracy')
248257
tracy_dep = dependency('tracy')
249-
deps += [allegro_dep, luajit_dep, loadpng_dep, raknet_dep, boost_dep, tracy_dep]
258+
deps += [sdl3_dep, sdl3_image_dep, allegro_dep, luajit_dep, loadpng_dep, raknet_dep, boost_dep, tracy_dep]
250259

251260
#### Sources Setup ####
252261
source_inc_dirs = []

0 commit comments

Comments
 (0)