aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/std/build/ConfigHeaderStep.zig27
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/std/build/ConfigHeaderStep.zig b/lib/std/build/ConfigHeaderStep.zig
index fcfd876b53..23a21a1481 100644
--- a/lib/std/build/ConfigHeaderStep.zig
+++ b/lib/std/build/ConfigHeaderStep.zig
@@ -151,6 +151,20 @@ fn make(step: *Step) !void {
try output.appendSlice("/* This file was generated by ConfigHeaderStep using the Zig Build System. */\n");
+ switch (self.style) {
+ .autoconf => try render_autoconf(contents, &output, &values_copy, src_path),
+ .cmake => try render_cmake(contents, &output, &values_copy, src_path),
+ }
+
+ try dir.writeFile(self.output_basename, output.items);
+}
+
+fn render_autoconf(
+ contents: []const u8,
+ output: *std.ArrayList(u8),
+ values_copy: *std.StringHashMap(Value),
+ src_path: []const u8,
+) !void {
var any_errors = false;
var line_index: u32 = 0;
var line_it = std.mem.split(u8, contents, "\n");
@@ -216,6 +230,17 @@ fn make(step: *Step) !void {
if (any_errors) {
return error.HeaderConfigFailed;
}
+}
- try dir.writeFile(self.output_basename, output.items);
+fn render_cmake(
+ contents: []const u8,
+ output: *std.ArrayList(u8),
+ values_copy: *std.StringHashMap(Value),
+ src_path: []const u8,
+) !void {
+ _ = contents;
+ _ = output;
+ _ = values_copy;
+ _ = src_path;
+ @panic("TODO: render_cmake is not implemented yet");
}