std.Build.Step.ConfigHeader: better error message

This commit is contained in:
jd 2024-04-15 07:53:21 +02:00 committed by Andrew Kelley
parent 64b9893582
commit d23a8e83d4

View File

@ -203,7 +203,11 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
.cmake => |file_source| {
try output.appendSlice(c_generated_line);
const src_path = file_source.getPath(b);
const contents = try std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes);
const contents = std.fs.cwd().readFileAlloc(arena, src_path, self.max_bytes) catch |err| {
return step.fail("unable to read cmake input file '{s}': {s}", .{
src_path, @errorName(err),
});
};
try render_cmake(step, contents, &output, self.values, src_path);
},
.blank => {