2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2025-01-17 15:30:44 +01:00

wscript: don't force 32-bit for OSX users, as OSX don't support launching 32-bit applications since Catalina

Add `-4` or `--32bits` configure flag to specifically target 32-bit engine
Add a fix for VGUI linking from the engine
This commit is contained in:
Alibek Omarov 2024-08-11 18:12:44 +03:00
parent 518a5c185c
commit 9cd751eef1
2 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,7 @@ def options(opt):
@conf
def check_vgui(conf):
if conf.env.DEST_CPU == 'x86' or (conf.env.DEST_CPU == 'x86_64' and not conf.options.ALLOW64):
if conf.env.DEST_CPU == 'x86' or (conf.env.DEST_CPU == 'x86_64' and conf.env.DEST_SIZEOF_VOID_P == 4):
vgui_dest_cpu = 'x86' # link with 32-bit binary when crosscompiling to 32-bit
else: vgui_dest_cpu = conf.env.DEST_CPU

13
wscript
View File

@ -26,7 +26,9 @@ def options(opt):
grp = opt.add_option_group('Common options')
grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False,
help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %(default)s]')
help = 'allow targetting 64-bit libs (Linux/Windows/OSX x86 only) [default: %(default)s]')
grp.add_option('-4', '--32bits', action = 'store_true', dest = 'FORCE32', default = False,
help = 'force targetting 32-bit libs, usually unneeded [default: %(default)s]')
grp.add_option('--disable-werror', action = 'store_true', dest = 'DISABLE_WERROR', default = False,
help = 'disable compilation abort on warning')
grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'USE_VOICEMGR', default = False,
@ -66,12 +68,13 @@ def configure(conf):
# We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture
# Because compatibility with original GoldSrc
if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU == 'x86_64':
if conf.env.DEST_OS in ['win32', 'linux'] and conf.env.DEST_CPU == 'x86_64':
conf.env.BIT32_MANDATORY = not conf.options.ALLOW64
if conf.env.BIT32_MANDATORY:
Logs.info('WARNING: will build game for 32-bit target')
else:
conf.env.BIT32_MANDATORY = False
conf.env.BIT32_MANDATORY = conf.options.FORCE32
if conf.env.BIT32_MANDATORY:
Logs.info('WARNING: will build game for 32-bit target')
conf.load('force_32bit')