summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-11-02 09:11:29 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-11-02 09:11:50 +0100
commitcefdb34f6c1af31048340182c10587099c39da44 (patch)
treea2ebb74b5c5182d8f767be77ce36e76a694d1b2f /platform
parent51b7fd90e645ab8c39d55268d2c8c5eb38925fc1 (diff)
SCons: make use_lto a global option and opt-in for iphone
Supersedes #12553, see discussion in #12552.
Diffstat (limited to 'platform')
-rw-r--r--platform/iphone/detect.py8
-rw-r--r--platform/windows/detect.py1
-rw-r--r--platform/x11/detect.py1
3 files changed, 6 insertions, 4 deletions
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index 00d8a59f74..993a93ff89 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -47,8 +47,8 @@ def configure(env):
if (env["target"].startswith("release")):
env.Append(CPPFLAGS=['-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1'])
- env.Append(CPPFLAGS=['-O2', '-flto', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations'])
- env.Append(LINKFLAGS=['-O2', '-flto'])
+ env.Append(CPPFLAGS=['-O2', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations'])
+ env.Append(LINKFLAGS=['-O2'])
if env["target"] == "release_debug":
env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])
@@ -56,6 +56,10 @@ def configure(env):
elif (env["target"] == "debug"):
env.Append(CPPFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ if (env["use_lto"]):
+ env.Append(CPPFLAGS=['-flto'])
+ env.Append(LINKFLAGS=['-flto'])
+
## Architecture
if env["ios_sim"] or env["arch"] == "x86": # i386, simulator
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index bac5df5668..fbb02c9d1b 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -64,7 +64,6 @@ def get_opts():
return [
('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32),
('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64),
- BoolVariable('use_lto', 'Use link time optimization (when using MingW)', False),
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
]
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 56bc1d4c59..6bd0ac8317 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -52,7 +52,6 @@ def get_opts():
BoolVariable('use_static_cpp', 'Link stdc++ statically', False),
BoolVariable('use_sanitizer', 'Use LLVM compiler address sanitizer', False),
BoolVariable('use_leak_sanitizer', 'Use LLVM compiler memory leaks sanitizer (implies use_sanitizer)', False),
- BoolVariable('use_lto', 'Use link time optimization', False),
BoolVariable('pulseaudio', 'Detect & use pulseaudio', True),
BoolVariable('udev', 'Use udev for gamepad connection callbacks', False),
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),