1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Respect use_lto option for building iPhone template

This commit is contained in:
volzhs
2017-11-01 12:30:30 +09:00
parent 290b32ee57
commit 50868dfd27

View File

@@ -31,6 +31,7 @@ def get_opts():
('ios_exceptions', 'Enable exceptions', 'no'), ('ios_exceptions', 'Enable exceptions', 'no'),
('ios_triple', 'Triple for ios toolchain', ''), ('ios_triple', 'Triple for ios toolchain', ''),
('ios_sim', 'Build simulator binary', 'no'), ('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")): if (env["target"].startswith("release")):
env.Append(CPPFLAGS=['-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1']) 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(CPPFLAGS=['-O2', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations'])
env.Append(LINKFLAGS=['-O2', '-flto']) env.Append(LINKFLAGS=['-O2'])
if env['use_lto'] == 'yes':
env.Append(CPPFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
if env["target"] == "release_debug": if env["target"] == "release_debug":
env.Append(CPPFLAGS=['-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_ENABLED'])