engine: wscript: add an ability to build with SDL3

This commit is contained in:
Alibek Omarov 2024-10-10 06:13:56 +03:00
parent c05db9ce58
commit 5db880af57

View file

@ -80,6 +80,11 @@ def configure(conf):
conf.env.HAVE_SDL2 = True conf.env.HAVE_SDL2 = True
else: else:
conf.load('sdl2') conf.load('sdl2')
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: if not conf.env.HAVE_SDL2:
conf.fatal('SDL2 not available! If you want to build dedicated server, specify --dedicated') conf.fatal('SDL2 not available! If you want to build dedicated server, specify --dedicated')
conf.define('XASH_SDL', 2) conf.define('XASH_SDL', 2)
@ -172,8 +177,8 @@ def build(bld):
source += bld.path.ant_glob(['platform/misc/lib_static.c']) source += bld.path.ant_glob(['platform/misc/lib_static.c'])
is_cxx_link = True is_cxx_link = True
if bld.env.HAVE_SDL2: if bld.env.HAVE_SDL2 or bld.env.HAVE_SDL3:
libs.append('SDL2') libs.append('SDL3' if bld.env.HAVE_SDL3 else 'SDL2')
source += bld.path.ant_glob(['platform/sdl/*.c']) source += bld.path.ant_glob(['platform/sdl/*.c'])
if bld.env.MAGX: if bld.env.MAGX: