2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-28 13:09:13 +01:00

scripts: waifulib: compiler_optimizations: synchronize with engine

This commit is contained in:
Alibek Omarov 2023-04-16 04:01:26 +03:00
parent 840457f471
commit 459ac7fa02

View File

@ -118,7 +118,7 @@ POLLY_CFLAGS = {
def options(opt): def options(opt):
grp = opt.add_option_group('Compiler optimization options') grp = opt.add_option_group('Compiler optimization options')
grp.add_option('-T', '--build-type', action='store', dest='BUILD_TYPE', default=None, grp.add_option('-T', '--build-type', action='store', dest='BUILD_TYPE', default='release',
help = 'build type: debug, release or none(custom flags)') help = 'build type: debug, release or none(custom flags)')
grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False,
@ -129,12 +129,11 @@ def options(opt):
def configure(conf): def configure(conf):
conf.start_msg('Build type') conf.start_msg('Build type')
if conf.options.BUILD_TYPE == None:
conf.end_msg('not set', color='RED') if not conf.options.BUILD_TYPE in VALID_BUILD_TYPES:
conf.fatal('Set a build type, for example "-T release"')
elif not conf.options.BUILD_TYPE in VALID_BUILD_TYPES:
conf.end_msg(conf.options.BUILD_TYPE, color='RED') conf.end_msg(conf.options.BUILD_TYPE, color='RED')
conf.fatal('Invalid build type. Valid are: %s' % ', '.join(VALID_BUILD_TYPES)) conf.fatal('Invalid build type. Valid are: %s' % ', '.join(VALID_BUILD_TYPES))
conf.end_msg(conf.options.BUILD_TYPE) conf.end_msg(conf.options.BUILD_TYPE)
conf.msg('LTO build', 'yes' if conf.options.LTO else 'no') conf.msg('LTO build', 'yes' if conf.options.LTO else 'no')
@ -175,5 +174,7 @@ def get_optimization_flags(conf):
elif conf.env.DEST_OS == 'psvita': elif conf.env.DEST_OS == 'psvita':
# this optimization is broken in vitasdk # this optimization is broken in vitasdk
cflags.append('-fno-optimize-sibling-calls') cflags.append('-fno-optimize-sibling-calls')
# remove fvisibility to allow everything to be exported by default
cflags.remove('-fvisibility=hidden')
return cflags, linkflags return cflags, linkflags