authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-23 23:20:33 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-23 23:20:33 -08:00
loge2d42e8ff71c3e6f534a380b7d16465fa77032f7
tree404d2bf4adfb9c59557713877ec662cafb08371f
parentf3aabb5e4e3baa7cf58af4f36f8683532d49fce3

add deps.addAllLibrariesTo(), closes #84


4 files changed, 19 insertions(+), 0 deletions(-)

deps.zig+5
......@@ -95,6 +95,11 @@ pub fn addAllTo(exe: *std.build.LibExeObjStep) void {
9595 const moddep = pkg.zp(b);
9696 exe.addModule(moddep.name, moddep.module);
9797 }
98 addAllLibrariesTo(exe);
99}
100
101pub fn addAllLibrariesTo(exe: *std.build.LibExeObjStep) void {
102 const b = exe.step.owner;
98103 var llc = false;
99104 var vcpkg = false;
100105 inline for (comptime std.meta.declarations(package_data)) |decl| {
docs/deps.zig.md+4
......@@ -15,6 +15,10 @@ A helper function to automatically pull in dependencies, purely from the `zig bu
1515- Type: `pub fn (exe: *std.build.LibExeObjStep) void`
1616A helper function to add all of the packages, C files, and system libraries to the passed exectuable. It will also automatically link libC in the event that any C files are found in the dependency tree.
1717
18### `addAllLibrariesTo`
19- Type: `pub fn (exe: *std.build.LibExeObjStep) void`
20A helper function called by `addAllTo` that adds the C files and libraries.
21
1822### `Package`
1923```zig
2024pub const Package = struct {
src/cmd/fetch.zig+5
......@@ -63,6 +63,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
6363 \\ const moddep = pkg.zp(b);
6464 \\ exe.addModule(moddep.name, moddep.module);
6565 \\ }
66 \\ addAllLibrariesTo(exe);
67 \\}
68 \\
69 \\pub fn addAllLibrariesTo(exe: *std.build.LibExeObjStep) void {
70 \\ const b = exe.step.owner;
6671 \\ var llc = false;
6772 \\ var vcpkg = false;
6873 \\ inline for (comptime std.meta.declarations(package_data)) |decl| {
src/cmd/generate.zig+5
......@@ -132,6 +132,11 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D
132132 \\ const moddep = pkg.zp(b);
133133 \\ exe.addModule(moddep.name, moddep.module);
134134 \\ }
135 \\ addAllLibrariesTo(exe);
136 \\}
137 \\
138 \\pub fn addAllLibrariesTo(exe: *std.build.LibExeObjStep) void {
139 \\ const b = exe.step.owner;
135140 \\ var llc = false;
136141 \\ var vcpkg = false;
137142 \\ inline for (comptime std.meta.declarations(package_data)) |decl| {