| ... | @@ -5,6 +5,7 @@ const Io = std.Io; | ... | @@ -5,6 +5,7 @@ const Io = std.Io; |
| 5 | const Configuration = std.Build.Configuration; | 5 | const Configuration = std.Build.Configuration; |
| 6 | const allocPrint = std.fmt.allocPrint; | 6 | const allocPrint = std.fmt.allocPrint; |
| 7 | const assert = std.debug.assert; | 7 | const assert = std.debug.assert; |
| | 8 | const OptimizeMode = std.lang.OptimizeMode; |
| 8 | | 9 | |
| 9 | const Step = @import("../Step.zig"); | 10 | const Step = @import("../Step.zig"); |
| 10 | const Maker = @import("../../Maker.zig"); | 11 | const Maker = @import("../../Maker.zig"); |
| ... | @@ -47,10 +48,13 @@ pub fn make( | ... | @@ -47,10 +48,13 @@ pub fn make( |
| 47 | } | 48 | } |
| 48 | } | 49 | } |
| 49 | | 50 | |
| 50 | switch (conf_tc.flags.optimize) { | 51 | const opt: ?OptimizeMode = switch (conf_tc.flags.optimize) { |
| 51 | .debug, .default => {}, // Skip since it's the default. | 52 | .debug, .default => null, // Skip since it's the default |
| 52 | else => argv.appendAssumeCapacity(try allocPrint(arena, "-O{t}", .{conf_tc.flags.optimize})), | 53 | .safe => .ReleaseSafe, |
| 53 | } | 54 | .fast => .ReleaseFast, |
| | 55 | .small => .ReleaseSmall, |
| | 56 | }; |
| | 57 | if (opt) |o| argv.appendAssumeCapacity(try allocPrint(arena, "-O{t}", .{o})); |
| 54 | | 58 | |
| 55 | try argv.ensureUnusedCapacity(arena, conf_tc.include_dirs.len * 2); | 59 | try argv.ensureUnusedCapacity(arena, conf_tc.include_dirs.len * 2); |
| 56 | for (0..conf_tc.include_dirs.len) |i| | 60 | for (0..conf_tc.include_dirs.len) |i| |