mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 15:31:48 +00:00
std/build: Add support for LTO configuration
This commit is contained in:
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user