Skip to content

Commit

Permalink
scripts: waifulib: compiler_optimizations: rename release build type …
Browse files Browse the repository at this point in the history
…to humanrights with kept compatibility
  • Loading branch information
a1batross committed Nov 2, 2023
1 parent bd969f3 commit a464c3d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/waifulib/compiler_optimizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
'''

VALID_BUILD_TYPES = ['fastnative', 'fast', 'release', 'debug', 'sanitize', 'msan', 'none']
VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'none']

LINKFLAGS = {
'common': {
Expand Down Expand Up @@ -75,7 +75,7 @@
'clang': ['-Ofast', '-march=native'],
'default': ['-O3']
},
'release': {
'humanrights': {
'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'],
'gcc': ['-O3', '-fno-semantic-interposition'],
Expand Down Expand Up @@ -119,7 +119,7 @@
def options(opt):
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)')

grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False,
Expand All @@ -131,6 +131,11 @@ def options(opt):
def configure(conf):
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:
conf.end_msg(conf.options.BUILD_TYPE, color='RED')
conf.fatal('Invalid build type. Valid are: %s' % ', '.join(VALID_BUILD_TYPES))
Expand Down

1 comment on commit a464c3d

@TheEvilSkeleton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based

Please sign in to comment.