from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile',
- 'release')))
+ 'release', 'opt')))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code',
default_machine,
if env['build'] == 'profile':
env['debug'] = False
env['profile'] = True
- if env['build'] == 'release':
+ if env['build'] in ('release', 'opt'):
env['debug'] = False
env['profile'] = False
cppdefines += ['NDEBUG']
if env['build'] == 'profile':
cppdefines += ['PROFILE']
+ if env['build'] in ('opt', 'profile'):
+ cppdefines += ['VMX86_STATS']
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
cppdefines += [
'_POSIX_SOURCE',
ccflags += [
'/O2', # optimize for speed
]
- if env['build'] == 'release':
+ if env['build'] in ('release', 'opt'):
if not env['clang']:
ccflags += [
'/GL', # enable whole program optimization
shlinkflags += ['-Wl,--enable-stdcall-fixup']
#shlinkflags += ['-Wl,--kill-at']
if msvc:
- if env['build'] == 'release' and not env['clang']:
+ if env['build'] in ('release', 'opt') and not env['clang']:
# enable Link-time Code Generation
linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG'])