Skip to content

Commit 39d62f1

Browse files
committed
add -flto (link time optimization)
msvc was already using /LTGC also, add /GL to all files in msvc, may provide some additional help
1 parent a0a7281 commit 39d62f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

SConscript

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,17 @@ if GetOption('debugging'):
468468
env.Append(CPPDEFINES=['DEBUG'])
469469
elif GetOption('release'):
470470
if msvc:
471-
env.Append(CCFLAGS=['/O2', '/Oy-', '/fp:fast'])
471+
env.Append(CCFLAGS=['/O2', '/Oy-', '/fp:fast', '/GL'])
472472
if GetOption('static'):
473473
env.Append(CCFLAGS=['/MT'])
474474
else:
475475
env.Append(CCFLAGS=['/MD'])
476476
else:
477-
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer'])
477+
env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer', '-flto'])
478478
if platform != "Darwin":
479479
env.Append(CCFLAGS=['-funsafe-loop-optimizations'])
480+
#-flto: link time optimization, gives a noticeable speed boost
481+
env.Append(LINKFLAGS=['-flto'])
480482

481483
if GetOption('static'):
482484
if platform == "Windows":

0 commit comments

Comments
 (0)