std/build: Add support for LTO configuration
This commit is contained in:
committed by
Veikka Tuominen
parent
4f11a88b9f
commit
3c0238e731
@@ -1421,6 +1421,8 @@ pub const LibExeObjStep = struct {
|
||||
/// Overrides the default stack size
|
||||
stack_size: ?u64 = null,
|
||||
|
||||
want_lto: ?bool = null,
|
||||
|
||||
const LinkObject = union(enum) {
|
||||
StaticPath: []const u8,
|
||||
OtherStep: *LibExeObjStep,
|
||||
@@ -2589,6 +2591,14 @@ pub const LibExeObjStep = struct {
|
||||
}
|
||||
}
|
||||
|
||||
if (self.want_lto) |lto| {
|
||||
if (lto) {
|
||||
try zig_args.append("-flto");
|
||||
} else {
|
||||
try zig_args.append("-fno-lto");
|
||||
}
|
||||
}
|
||||
|
||||
if (self.subsystem) |subsystem| {
|
||||
try zig_args.append("--subsystem");
|
||||
try zig_args.append(switch (subsystem) {
|
||||
|
||||
Reference in New Issue
Block a user