From 5db880af571bd8c7878caf6575083965b694b3f8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 10 Oct 2024 06:13:56 +0300 Subject: [PATCH] engine: wscript: add an ability to build with SDL3 --- engine/wscript | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/engine/wscript b/engine/wscript index 16075adb..ad56f032 100644 --- a/engine/wscript +++ b/engine/wscript @@ -80,9 +80,14 @@ def configure(conf): conf.env.HAVE_SDL2 = True else: conf.load('sdl2') - if not conf.env.HAVE_SDL2: - conf.fatal('SDL2 not available! If you want to build dedicated server, specify --dedicated') - conf.define('XASH_SDL', 2) + if conf.options.SDL3: + if not conf.env.HAVE_SDL3: + conf.fatal('SDL3 not available! If you want to build dedicated server, specify --dedicated') + conf.define('XASH_SDL', 3) + else: + if not conf.env.HAVE_SDL2: + conf.fatal('SDL2 not available! If you want to build dedicated server, specify --dedicated') + conf.define('XASH_SDL', 2) if conf.env.DEST_OS == 'haiku': conf.env.LIB_HAIKU = ['network'] @@ -172,8 +177,8 @@ def build(bld): source += bld.path.ant_glob(['platform/misc/lib_static.c']) is_cxx_link = True - if bld.env.HAVE_SDL2: - libs.append('SDL2') + if bld.env.HAVE_SDL2 or bld.env.HAVE_SDL3: + libs.append('SDL3' if bld.env.HAVE_SDL3 else 'SDL2') source += bld.path.ant_glob(['platform/sdl/*.c']) if bld.env.MAGX: