authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-07 00:40:32-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:14-07:00
log3b069907305497af5ef6cdb1d6adddd05636aa51
tree8a7b1df73f436781ba817564283795997cfa3677
parent8510f9e2bc1c1da6b3d12a07ae613cb3ca888d63

std.Build.CompileStep: tweak the default step name


1 files changed, 14 insertions(+), 2 deletions(-)

lib/std/Build/CompileStep.zig+14-2
...@@ -310,8 +310,20 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {...@@ -310,8 +310,20 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {
310 panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name});310 panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name});
311 }311 }
312312
313 const step_name = owner.fmt("compile {s} {s} {s}", .{313 // Avoid the common case of the step name looking like "zig test test".
314 name,314 const name_adjusted = if (options.kind == .@"test" and mem.eql(u8, name, "test"))
315 ""
316 else
317 owner.fmt("{s} ", .{name});
318
319 const step_name = owner.fmt("{s} {s}{s} {s}", .{
320 switch (options.kind) {
321 .exe => "zig build-exe",
322 .lib => "zig build-lib",
323 .obj => "zig build-obj",
324 .test_exe, .@"test" => "zig test",
325 },
326 name_adjusted,
315 @tagName(options.optimize),327 @tagName(options.optimize),
316 options.target.zigTriple(owner.allocator) catch @panic("OOM"),328 options.target.zigTriple(owner.allocator) catch @panic("OOM"),
317 });329 });