authorgravatar for hubert.jasudowicz@gmail.comHubert Jasudowicz <hubert.jasudowicz@gmail.com> 2021-02-22 20:37:10+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-02-25 22:25:42+02:00
log3c0238e731d3ec0514dc4a563817d6a27fed272e
tree737f22956442edb48f82a291da4eb1baaff411f9
parent4f11a88b9f21a365cf2281e840ed12b0d4e687a6

std/build: Add support for LTO configuration


1 files changed, 10 insertions(+), 0 deletions(-)

lib/std/build.zig+10
......@@ -1421,6 +1421,8 @@ pub const LibExeObjStep = struct {
14211421 /// Overrides the default stack size
14221422 stack_size: ?u64 = null,
14231423
1424 want_lto: ?bool = null,
1425
14241426 const LinkObject = union(enum) {
14251427 StaticPath: []const u8,
14261428 OtherStep: *LibExeObjStep,
......@@ -2589,6 +2591,14 @@ pub const LibExeObjStep = struct {
25892591 }
25902592 }
25912593
2594 if (self.want_lto) |lto| {
2595 if (lto) {
2596 try zig_args.append("-flto");
2597 } else {
2598 try zig_args.append("-fno-lto");
2599 }
2600 }
2601
25922602 if (self.subsystem) |subsystem| {
25932603 try zig_args.append("--subsystem");
25942604 try zig_args.append(switch (subsystem) {