| 1 | //! Fail the build with a given message. |
| 2 | const Fail = @This(); |
| 3 | |
| 4 | const std = @import("std"); |
| 5 | const Step = std.Build.Step; |
| 6 | const Configuration = std.Build.Configuration; |
| 7 | |
| 8 | step: Step, |
| 9 | error_msg: Configuration.String, |
| 10 | |
| 11 | pub const base_tag: Step.Tag = .fail; |
| 12 | |
| 13 | pub fn create(owner: *std.Build, error_msg: []const u8) *Fail { |
| 14 | const graph = owner.graph; |
| 15 | const fail = graph.create(Fail); |
| 16 | fail.* = .{ |
| 17 | .step = .init(.{ |
| 18 | .tag = base_tag, |
| 19 | .name = "fail", |
| 20 | .owner = owner, |
| 21 | }), |
| 22 | .error_msg = graph.addString(error_msg), |
| 23 | }; |
| 24 | return fail; |
| 25 | } |