diff --git a/nc_optimisation.cmake b/nc_optimisation.cmake index 28de5d8..27125c1 100644 --- a/nc_optimisation.cmake +++ b/nc_optimisation.cmake @@ -28,11 +28,17 @@ if (LTO) append_link_flag("-fuse-linker-plugin") append_link_flag("-flto") - # Actually enable LTO object creation, but try very hard to avoid + # Enable LTO on the compilation side, but try very hard to avoid # situations where we may accidentally use regular/fat objects. append_compile_flag("-flto") append_compile_flag("-fno-fat-lto-objects") + # Try to squeeze out some more diagnostics via LTO + append_compile_flag("-flto-odr-type-merging") + + # GCC: Attempt to use a more aggressive whole-program style of LTO + append_compile_flag("-flto-partition=none") + # Throw in some optimisation flags that are LTO specific. We don't # particularly care about checking Debug/Release here because LTO is # pretty heavyweight anyway.