[Optimizations] Enable lto by default + recursively optimize one level if needed

This commit is contained in:
Antoine Viallon 2023-05-02 20:30:55 +02:00
parent d3e80fda86
commit 2a7d942702
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -14,6 +14,9 @@ let
extraCFlags ? cfg.extraCompileFlags,
blacklist ? cfg.blacklist,
overrideMap ? cfg.overrideMap,
recursive ? 1,
level ? "slower",
lto ? cfg.lto,
...
}@attrs: pkg:
myLib.optimizations.optimizePkg pkg ({
@ -27,7 +30,11 @@ in {
description = "Enable aviallon's optimizations";
type = types.bool;
};
lto = mkEnableOption "enable LTO for some packages";
lto = mkOption {
description = "Wether to enable LTO for some packages";
type = types.bool;
default = true;
};
extraCompileFlags = mkOption {
default = [ "-mtune=${generalCfg.cpuTune}" ];
example = [ "-O2" "-mavx" ];