From 453c0d890d1bf8d470bf621924b179b0939dc649 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 5 Nov 2019 01:35:20 +0300 Subject: [PATCH] engine: wscript: rename fbdev to enable-fbdev for great consistency, check definition instead of putting vars into env --- engine/wscript | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/engine/wscript b/engine/wscript index c7baf2f2..4a1380e3 100644 --- a/engine/wscript +++ b/engine/wscript @@ -12,10 +12,13 @@ def options(opt): grp.add_option('--enable-stdin-input', action = 'store_true', dest = 'USE_SELECT', default = False, help = 'enable console input from stdin (always enabled for dedicated) [default: %default]') - grp.add_option('--fbdev', action = 'store_true', dest = 'FBDEV_SW', default = False, + + grp.add_option('--enable-fbdev', action = 'store_true', dest = 'FBDEV_SW', default = False, help = 'build fbdev-only software-only engine') + grp.add_option('--disable-async-resolve', action = 'store_true', dest = 'NO_ASYNC_RESOLVE', default = False, - help = 'disable asynchronous name resolution') + help = 'disable multithreaded operations(asynchronous name resolution)') + grp.add_option('--enable-custom-swap', action = 'store_true', dest = 'CUSTOM_SWAP', default = False, help = 'enable custom swap allocator. For devices with no swap support') @@ -43,13 +46,10 @@ def configure(conf): if conf.options.USE_SELECT == None: conf.options.USE_SELECT = conf.options.DEDICATED - if not conf.env.DEST_OS in ['win32', 'android'] and not conf.options.NO_ASYNC_RESOLVE: conf.check_cc( lib='pthread' ) - if conf.options.CUSTOM_SWAP: - conf.define('XASH_CUSTOM_SWAP',1) - conf.env.CUSTOM_SWAP = True + conf.define_conf('XASH_CUSTOM_SWAP', conf.options.CUSTOM_SWAP) conf.define_cond('SINGLE_BINARY', conf.env.SINGLE_BINARY) conf.define_cond('XASH_NO_ASYNC_NS_RESOLVE', conf.options.NO_ASYNC_RESOLVE) conf.define_cond('XASH_USE_SELECT', conf.options.USE_SELECT or conf.options.DEDICATED) @@ -71,7 +71,6 @@ def build(bld): if bld.env.DEST_OS != 'win32': libs += [ 'DL' , 'M' , 'RT', 'PTHREAD', 'ASOUND'] source += bld.path.ant_glob(['platform/posix/*.c']) - else: libs += ['USER32', 'SHELL32', 'GDI32', 'ADVAPI32', 'DBGHELP', 'PSAPI', 'WS2_32' ] source += bld.path.ant_glob(['platform/win32/*.c']) @@ -79,7 +78,7 @@ def build(bld): if bld.env.DEST_OS == 'linux': source += bld.path.ant_glob(['platform/linux/*.c']) - if bld.env.CUSTOM_SWAP: + if bld.get_define('XASH_CUSTOM_SWAP'): source += bld.path.ant_glob(['platform/swap/*.c']) if bld.env.HAVE_SDL2: @@ -97,7 +96,7 @@ def build(bld): 'client/vgui/*.c', 'client/avi/*.c']) - # HACK: public headers must be put before common, so we don't get wrong mathlib included + # HACK: public headers must be put before SDK common, so we don't get wrong mathlib included includes = ['common', 'server', 'client', 'client/vgui', '.', '../public', '../common', '../pm_shared' ] if bld.env.SINGLE_BINARY: