Skip to content

Add option to build CMake itself with IPO/LTO

Cristian Adam requested to merge cristianadam/cmake:EnableIPOBuild into master

Create a CMake_BUILD_LTO option when building with a CMake that is new enough to support CheckIPOSupported everywhere.

By enabling IPO (interprocedural optimization IPO/LTO) for binary releases we will have smaller binaries.

My installation (cmake, ctest, cpack only) went from 33,3MB to 27,9MB (5,4MB difference). The tar.gz file went from 12,9MB to 10,6MB (2,3MB difference).

The Linux x86_64 also contains the ccmake and cmake-gui binaries, which I don't know how they will be affected.

I have tested the binaries on our code base, and there were no observable differences between IPO, and the regular build.

Edited by Brad King

Merge request reports