Don't force choice of "thin" IPO
At the moment, when one enables IPO, CMake silently opts for "thin" objects, i.e. ones which have the minimum required information for performing IPO - which assumes the rest of the build toolchain has maximal support for IPO (e.g. re-invoking a compiler). For GCC, this is -fno-fat-lto-objects
, and for clang it's -flto=thin
.
It is not reasonable to enforce this. One of the following needs to happen:
- The
INTERPROCEDURAL_OPTIMIZATION
target property should have additional options, e.g.NONE
,THIN
, andFAT
/FULL
. - There should be an additional target property for IPO "fatness"
-
INTERPROCEDURAL_OPTIMIZATION
will not tell the compiler anything abut "fatness" and leave it up to the user.
I like option (1.), though option (2.) would maximize compatibility with previous CMake versions. Although... one could have options OFF, ON and THIN - different option type, but subsumes the previous range of options.