What's the correct way to enable whole program optimization with CMake and g++? I know about CMake's INTERPROCEDURAL_OPTIMIZATION
variable, but it looks like there are additional optimizations available if I specify -fuse-linker-plugin
, -ffat-lto-objects
, and possibly others.
What's the most aggressive optimization I can do in terms of cross-object optimization, and how do I enable this with g++ and CMake?