Merge pull request #12578 from volzhs/lto-iphone

Respect use_lto option for building iPhone template

[ci skip]
This commit is contained in:
Rémi Verschelde 2017-11-02 09:39:57 +01:00 committed by GitHub
commit 56a5c643dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ def get_opts():
('ios_exceptions', 'Enable exceptions', 'no'),
('ios_triple', 'Triple for ios toolchain', ''),
('ios_sim', 'Build simulator binary', 'no'),
('use_lto', 'Use link time optimization', 'no')
]
@ -147,8 +148,11 @@ 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['use_lto'] == 'yes':
env.Append(CPPFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
if env["target"] == "release_debug":
env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])