Skip to content

Commit 07a7b01

Browse files
Enable LTO for Android release builds, when the compiler supports it
1 parent d3e93bc commit 07a7b01

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

config/android-settings.gypi

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
'variables':
3+
{
4+
'supports_lto': '<!(if ${CC} -flto -c -o /dev/null /dev/null 2>/dev/null >/dev/null; then echo 1; else echo 0; fi)',
5+
},
6+
27
'cflags':
38
[
49
'-fstrict-aliasing',
@@ -69,6 +74,26 @@
6974
'-O3',
7075
'-g3',
7176
],
77+
78+
'conditions':
79+
[
80+
[
81+
'supports_lto != 0',
82+
{
83+
'cflags':
84+
[
85+
'-flto',
86+
],
87+
88+
'ldflags':
89+
[
90+
'-flto',
91+
'-O3',
92+
'-g3',
93+
],
94+
},
95+
],
96+
],
7297

7398
'defines':
7499
[

0 commit comments

Comments
 (0)