From 7efeedcd896b340a95cae50cd8c175a178465d8b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 28 Feb 2023 21:13:54 -0700 Subject: [PATCH] std.Build.CompileStep: better default step name --- lib/std/Build/CompileStep.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/std/Build/CompileStep.zig b/lib/std/Build/CompileStep.zig index a7d2926770..491c8ac8e4 100644 --- a/lib/std/Build/CompileStep.zig +++ b/lib/std/Build/CompileStep.zig @@ -312,6 +312,12 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep { panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name}); } + const step_name = builder.fmt("compile {s} {s} {s}", .{ + name, + @tagName(options.optimize), + options.target.zigTriple(builder.allocator) catch @panic("OOM"), + }); + const self = builder.allocator.create(CompileStep) catch @panic("OOM"); self.* = CompileStep{ .strip = null, @@ -328,7 +334,7 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep { .frameworks = StringHashMap(FrameworkLinkInfo).init(builder.allocator), .step = Step.init(builder.allocator, .{ .id = base_id, - .name = name, + .name = step_name, .makeFn = make, }), .version = options.version,