mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 00:23:22 +00:00
std.build.ConfigHeaderStep: stub out cmake style
This commit is contained in:
parent
ea792011d1
commit
01e34c1cd9
@ -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");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user