Skip to content

Commit 01e34c1

Browse files
committed
std.build.ConfigHeaderStep: stub out cmake style
1 parent ea79201 commit 01e34c1

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

lib/std/build/ConfigHeaderStep.zig

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ fn make(step: *Step) !void {
151151

152152
try output.appendSlice("/* This file was generated by ConfigHeaderStep using the Zig Build System. */\n");
153153

154+
switch (self.style) {
155+
.autoconf => try render_autoconf(contents, &output, &values_copy, src_path),
156+
.cmake => try render_cmake(contents, &output, &values_copy, src_path),
157+
}
158+
159+
try dir.writeFile(self.output_basename, output.items);
160+
}
161+
162+
fn render_autoconf(
163+
contents: []const u8,
164+
output: *std.ArrayList(u8),
165+
values_copy: *std.StringHashMap(Value),
166+
src_path: []const u8,
167+
) !void {
154168
var any_errors = false;
155169
var line_index: u32 = 0;
156170
var line_it = std.mem.split(u8, contents, "\n");
@@ -216,6 +230,17 @@ fn make(step: *Step) !void {
216230
if (any_errors) {
217231
return error.HeaderConfigFailed;
218232
}
233+
}
219234

220-
try dir.writeFile(self.output_basename, output.items);
235+
fn render_cmake(
236+
contents: []const u8,
237+
output: *std.ArrayList(u8),
238+
values_copy: *std.StringHashMap(Value),
239+
src_path: []const u8,
240+
) !void {
241+
_ = contents;
242+
_ = output;
243+
_ = values_copy;
244+
_ = src_path;
245+
@panic("TODO: render_cmake is not implemented yet");
221246
}

0 commit comments

Comments
 (0)