-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make tools dependant on llvm optional
- Loading branch information
1 parent
a52bcdb
commit 12da866
Showing
2 changed files
with
226 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file implements a fail step for the build system | ||
// it's taken from Zig 0.14.0-dev and pasted here to be | ||
// used temporarily while we still target Zig 0.13.0 | ||
const std = @import("std"); | ||
const Step = std.Build.Step; | ||
const Fail = @This(); | ||
|
||
step: Step, | ||
error_msg: []const u8, | ||
|
||
pub const base_id: Step.Id = .custom; | ||
|
||
pub fn create(owner: *std.Build, error_msg: []const u8) *Fail { | ||
const fail = owner.allocator.create(Fail) catch @panic("OOM"); | ||
|
||
fail.* = .{ | ||
.step = Step.init(.{ | ||
.id = base_id, | ||
.name = "fail", | ||
.owner = owner, | ||
.makeFn = make, | ||
}), | ||
.error_msg = owner.dupe(error_msg), | ||
}; | ||
|
||
return fail; | ||
} | ||
|
||
fn make(step: *Step, prog_node: std.Progress.Node) !void { | ||
_ = prog_node; | ||
|
||
const fail: *Fail = @fieldParentPtr("step", step); | ||
|
||
try step.result_error_msgs.append(step.owner.allocator, fail.error_msg); | ||
|
||
return error.MakeFailed; | ||
} |
Oops, something went wrong.