Browse Source

scripts: waifulib: compiler_optimizations: rename release build type to humanrights with kept compatibility

pull/2/head
Alibek Omarov 1 year ago
parent
commit
a464c3dd66
  1. 11
      scripts/waifulib/compiler_optimizations.py

11
scripts/waifulib/compiler_optimizations.py

@ -30,7 +30,7 @@ compiler_optimizations.CFLAGS['gottagofast'] = {
} }
''' '''
VALID_BUILD_TYPES = ['fastnative', 'fast', 'release', 'debug', 'sanitize', 'msan', 'none'] VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'none']
LINKFLAGS = { LINKFLAGS = {
'common': { 'common': {
@ -75,7 +75,7 @@ CFLAGS = {
'clang': ['-Ofast', '-march=native'], 'clang': ['-Ofast', '-march=native'],
'default': ['-O3'] 'default': ['-O3']
}, },
'release': { 'humanrights': {
'msvc': ['/O2', '/Zi'], 'msvc': ['/O2', '/Zi'],
'owcc': ['-O3', '-foptimize-sibling-calls', '-fomit-leaf-frame-pointer', '-fomit-frame-pointer', '-fschedule-insns', '-funsafe-math-optimizations', '-funroll-loops', '-frerun-optimizer', '-finline-functions', '-finline-limit=512', '-fguess-branch-probability', '-fno-strict-aliasing', '-floop-optimize'], 'owcc': ['-O3', '-foptimize-sibling-calls', '-fomit-leaf-frame-pointer', '-fomit-frame-pointer', '-fschedule-insns', '-funsafe-math-optimizations', '-funroll-loops', '-frerun-optimizer', '-finline-functions', '-finline-limit=512', '-fguess-branch-probability', '-fno-strict-aliasing', '-floop-optimize'],
'gcc': ['-O3', '-fno-semantic-interposition'], 'gcc': ['-O3', '-fno-semantic-interposition'],
@ -119,7 +119,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='release', grp.add_option('-T', '--build-type', action='store', dest='BUILD_TYPE', default='humanrights',
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,
@ -131,6 +131,11 @@ def options(opt):
def configure(conf): def configure(conf):
conf.start_msg('Build type') conf.start_msg('Build type')
# legacy naming for default release build
# https://chaos.social/@karolherbst/111340511652012860
if conf.options.BUILD_TYPE == 'release':
conf.options.BUILD_TYPE = 'humanrights'
if not conf.options.BUILD_TYPE in VALID_BUILD_TYPES: if 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))

Loading…
Cancel
Save