From 1b372115a54b4467fab666f2a9d8f197b12d1c7b Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 19 Feb 2019 16:33:14 +0300 Subject: [PATCH] wscript: move options to subgroups, reorder option plugins loading --- engine/wscript | 15 +++++++++------ scripts/waflib/sdl2.py | 9 +++++---- vgui_support/wscript | 11 +++++------ wscript | 15 ++++++++------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/engine/wscript b/engine/wscript index 213a88ef..93c1309c 100644 --- a/engine/wscript +++ b/engine/wscript @@ -9,17 +9,20 @@ from fwgslib import get_subproject_name top = '.' def options(opt): - opt.load('sdl2') - opt.add_option( - '--enable-bsp2', action = 'store_true', dest = 'SUPPORT_BSP2_FORMAT', default = False, - help = 'build engine with BSP2 map support(recommended for Quake, breaks compability!)') - opt.add_option( + grp = opt.add_option_group('Engine options') + grp.add_option( + '--enable-bsp2', action = 'store_true', dest = 'SUPPORT_BSP2_FORMAT', default = False, + help = 'build engine with BSP2 map support(recommended for Quake, breaks compatibility!)') + + grp.add_option( '--single-binary', action = 'store_true', dest = 'SINGLE_BINARY', default = None, help = 'build single "xash" binary instead of xash.dll/libxash.so (default for dedicated)') - opt.add_option( + + grp.add_option( '--stdin-input', action = 'store_true', dest = 'USE_SELECT', default = None, help = 'enable console input from stdin (default for dedicated)') + opt.load('sdl2') def configure(conf): # check for dedicated server build diff --git a/scripts/waflib/sdl2.py b/scripts/waflib/sdl2.py index 0f20fcd5..30d46b53 100644 --- a/scripts/waflib/sdl2.py +++ b/scripts/waflib/sdl2.py @@ -14,13 +14,14 @@ import os def options(opt): - opt.add_option( + grp = opt.add_option_group('SDL2 options') + grp.add_option( '--sdl2', action='store', type='string', dest = 'SDL2_PATH', default = None, - help = 'SDL2 path to build(required for Windows)') + help = 'path to precompiled SDL2 library(required for Windows)') - opt.add_option( + grp.add_option( '--skip-sdl2-sanity-check', action='store_false', default = True, dest='SDL2_SANITY_CHECK', - help = 'Skip checking SDL2 sanity') + help = 'skip checking SDL2 sanity') def my_dirname(path): # really dumb, will not work with /path/framework//, but still enough diff --git a/vgui_support/wscript b/vgui_support/wscript index e9e987f2..29d163d4 100644 --- a/vgui_support/wscript +++ b/vgui_support/wscript @@ -9,19 +9,18 @@ from fwgslib import get_subproject_name top = '.' def options(opt): - opt.add_option( + grp = opt.add_option_group('VGUI options') + grp.add_option( '--vgui', action = 'store', type='string', dest = 'VGUI_DEV', help = 'path to vgui-dev repo', default='' ) - opt.add_option( + grp.add_option( '--disable-vgui', action = 'store_true', dest = 'NO_VGUI', help = 'disable vgui_support', default=False ) - opt.add_option( + grp.add_option( '--skip-vgui-sanity-check', action = 'store_false', dest = 'VGUI_SANITY_CHECK', - help = 'Skip checking VGUI sanity', default=True ) - - # stub + help = 'skip checking VGUI sanity', default=True ) return def configure(conf): diff --git a/wscript b/wscript index 09070f1b..8ff7a82f 100644 --- a/wscript +++ b/wscript @@ -17,27 +17,28 @@ SUBDIRS = [ 'engine', 'game_launch', 'mainui', 'vgui_support' ] top = '.' def options(opt): - opt.load('xcompile compiler_cxx compiler_c') - if sys.platform == 'win32': - opt.load('msvc msvs') + grp = opt.add_option_group('Common options') - opt.add_option( + grp.add_option( '--build-type', action='store', type='string', dest='BUILD_TYPE', default = None, help = 'build type: debug, release or none(custom flags)') - opt.add_option( + grp.add_option( '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False, help = 'build Xash Dedicated Server(XashDS)') - opt.add_option( + grp.add_option( '--64bits', action = 'store_true', dest = 'ALLOW64', default = False, help = 'allow targetting 64-bit engine') - opt.add_option( + grp.add_option( '--win-style-install', action = 'store_true', dest = 'WIN_INSTALL', default = False, help = 'install like Windows build, ignore prefix, useful for development') opt.recurse(SUBDIRS) + opt.load('xcompile compiler_cxx compiler_c') + if sys.platform == 'win32': + opt.load('msvc msvs') def configure(conf): conf.start_msg('Build type')