When: 2012-12-10
What: optional gcc LTO support with --enable-lto option
Who: Fabio Pedretti <fabio.ped@libero.it>
old
|
new
|
newoption { trigger = "icc", description
|
7 | 7 | newoption { trigger = "outpath", description = "Location for generated project files" } |
8 | 8 | newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" } |
9 | 9 | newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed. Has no effect on Windows builds" } |
| 10 | newoption { trigger = "enable-lto", description = "Enable experimental GCC LTO (Link Time Optimization)" } |
10 | 11 | newoption { trigger = "without-nvtt", description = "Disable use of NVTT" } |
11 | 12 | newoption { trigger = "without-tests", description = "Disable generation of test projects" } |
12 | 13 | newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } |
… |
… |
else
|
95 | 96 | minor = 0+minor |
96 | 97 | has_broken_pch = (major < 4 or (major == 4 and minor < 2)) |
97 | 98 | if has_broken_pch then |
98 | | print("WARNING: Detected GCC <4.2 -- disabling PCH for Atlas (will increase build times)") |
| 99 | print("WARNING: Detected GCC < 4.2 -- disabling PCH for Atlas (will increase build times)") |
| 100 | end |
| 101 | if _OPTIONS["enable-lto"] then |
| 102 | has_broken_lto = (major < 4 or (major == 4 and minor < 7)) |
| 103 | if has_broken_lto then |
| 104 | print("WARNING: Detected GCC < 4.7 -- disabling GCC LTO") |
| 105 | end |
99 | 106 | end |
100 | 107 | end |
101 | 108 | end |
… |
… |
function project_set_build_flags()
|
235 | 242 | } |
236 | 243 | end |
237 | 244 | |
| 245 | if _OPTIONS["enable-lto"] and not has_broken_lto then |
| 246 | buildoptions { "-flto" } |
| 247 | linkoptions { "-flto" } |
| 248 | end |
| 249 | |
238 | 250 | if arch == "x86" or arch == "amd64" then |
239 | 251 | buildoptions { |
240 | 252 | -- enable SSE intrinsics |