authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-15 15:07:38 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-15 15:07:38 -08:00
logc960a0ca49fe83a32b078b02594df799da908341
tree986c9949074d1468fa99354d4f89b06d0e0e23c4
parent9088248938a96929648d9fcddd37746017da3820

expose yaml mapping in module struct


3 files changed, 7 insertions(+), 0 deletions(-)

src/common.zig+2
......@@ -110,6 +110,7 @@ pub fn collect_deps(dir: []const u8, mpath: []const u8, comptime options: Collec
110110 .c_source_files = &[_][]const u8{},
111111 .deps = &[_]u.Module{},
112112 .clean_path = d.path,
113 .yaml = null,
113114 });
114115 },
115116 else => blk: {
......@@ -152,6 +153,7 @@ pub fn collect_deps(dir: []const u8, mpath: []const u8, comptime options: Collec
152153 .clean_path = "",
153154 .only_os = &[_][]const u8{},
154155 .except_os = &[_][]const u8{},
156 .yaml = m.yaml,
155157 };
156158}
157159
src/util/modfile.zig+2
......@@ -21,6 +21,7 @@ pub const ModFile = struct {
2121 c_source_flags: [][]const u8,
2222 c_source_files: [][]const u8,
2323 deps: []u.Dep,
24 yaml: yaml.Mapping,
2425
2526 pub fn init(alloc: *std.mem.Allocator, fpath: []const u8) !Self {
2627 //
......@@ -76,6 +77,7 @@ pub const ModFile = struct {
7677 .c_source_flags = try doc.mapping.get_string_array(alloc, "c_source_flags"),
7778 .c_source_files = try doc.mapping.get_string_array(alloc, "c_source_files"),
7879 .deps = dep_list.items,
80 .yaml = doc.mapping,
7981 };
8082 }
8183};
src/util/module.zig+3
......@@ -3,6 +3,7 @@ const gpa = std.heap.c_allocator;
33const builtin = @import("builtin");
44
55const u = @import("index.zig");
6const yaml = @import("./yaml.zig");
67
78//
89//
......@@ -17,6 +18,7 @@ pub const Module = struct {
1718 c_source_files: [][]const u8,
1819 only_os: [][]const u8,
1920 except_os: [][]const u8,
21 yaml: ?yaml.Mapping,
2022
2123 deps: []Module,
2224 clean_path: []const u8,
......@@ -34,6 +36,7 @@ pub const Module = struct {
3436 .clean_path = try dep.clean_path(),
3537 .only_os = dep.only_os,
3638 .except_os = dep.except_os,
39 .yaml = null,
3740 };
3841 }
3942