authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-28 21:13:54-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:13-07:00
log7efeedcd896b340a95cae50cd8c175a178465d8b
tree5fe49159ae56ee738255311ffe214c51bf4c51b2
parent7da34bd9e86fe32dec56e6e89a6d4615e2b50794

std.Build.CompileStep: better default step name


1 files changed, 7 insertions(+), 1 deletions(-)

lib/std/Build/CompileStep.zig+7-1
...@@ -312,6 +312,12 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep {...@@ -312,6 +312,12 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep {
312 panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name});312 panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name});
313 }313 }
314314
315 const step_name = builder.fmt("compile {s} {s} {s}", .{
316 name,
317 @tagName(options.optimize),
318 options.target.zigTriple(builder.allocator) catch @panic("OOM"),
319 });
320
315 const self = builder.allocator.create(CompileStep) catch @panic("OOM");321 const self = builder.allocator.create(CompileStep) catch @panic("OOM");
316 self.* = CompileStep{322 self.* = CompileStep{
317 .strip = null,323 .strip = null,
...@@ -328,7 +334,7 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep {...@@ -328,7 +334,7 @@ pub fn create(builder: *std.Build, options: Options) *CompileStep {
328 .frameworks = StringHashMap(FrameworkLinkInfo).init(builder.allocator),334 .frameworks = StringHashMap(FrameworkLinkInfo).init(builder.allocator),
329 .step = Step.init(builder.allocator, .{335 .step = Step.init(builder.allocator, .{
330 .id = base_id,336 .id = base_id,
331 .name = name,337 .name = step_name,
332 .makeFn = make,338 .makeFn = make,
333 }),339 }),
334 .version = options.version,340 .version = options.version,