Skip to content

Commit

Permalink
add -flto (link time optimization)
Browse files Browse the repository at this point in the history
msvc was already using /LTGC
also, add /GL to all files in msvc, may provide some additional help
  • Loading branch information
jacob1 committed Feb 22, 2018
1 parent a0a7281 commit 39d62f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SConscript
Expand Up @@ -468,15 +468,17 @@ if GetOption('debugging'):
env.Append(CPPDEFINES=['DEBUG'])
elif GetOption('release'):
if msvc:
env.Append(CCFLAGS=['/O2', '/Oy-', '/fp:fast'])
env.Append(CCFLAGS=['/O2', '/Oy-', '/fp:fast', '/GL'])
if GetOption('static'):
env.Append(CCFLAGS=['/MT'])
else:
env.Append(CCFLAGS=['/MD'])
else:
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer'])
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer', '-flto'])
if platform != "Darwin":
env.Append(CCFLAGS=['-funsafe-loop-optimizations'])
#-flto: link time optimization, gives a noticeable speed boost
env.Append(LINKFLAGS=['-flto'])

if GetOption('static'):
if platform == "Windows":
Expand Down

0 comments on commit 39d62f1

Please sign in to comment.