CMake: Add support for CMAKE_LTO option. #4799
This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units.
This is supported with the right setup on GCC, Clang and MSVC.
I only turn it on for the Release and RelWithDebInfo build types. It doesn't make to much sense on debug builds.
This should be fairly easy to port to the autoconf build system if you know what to do (I don't unfortunately).
The red builds seems unrelated, agreed.
It'd be great to perhaps change one of the existing cmake builds to use this feature indeed. I think it would make sense to do that as a separate PR. I'll merge this now and then changing a CI build should be easy. There are cmake builds on both travis and Azure to play with.