Turn on LTO for release builds

This commit is contained in:
Kovid Goyal 2017-10-05 21:18:21 +05:30
parent 259e01e879
commit 1c9612bd55
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -129,6 +129,8 @@ def init_env(debug=False, sanitize=False, native_optimizations=True, profile=Fal
ldflags = shlex.split(ldflags) ldflags = shlex.split(ldflags)
cflags += shlex.split(os.environ.get('CFLAGS', '')) cflags += shlex.split(os.environ.get('CFLAGS', ''))
ldflags += shlex.split(os.environ.get('LDFLAGS', '')) ldflags += shlex.split(os.environ.get('LDFLAGS', ''))
if not debug:
cflags.append('-flto'), ldflags.append('-flto')
if profile: if profile:
cflags.append('-DWITH_PROFILER') cflags.append('-DWITH_PROFILER')