From 215e053b9ace6e6e561b64cb06e2516021f76897 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 19 Mar 2023 20:42:05 -0500 Subject: [PATCH] chore: replace link() with getModule() --- build.zig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index d7168d9..504704d 100644 --- a/build.zig +++ b/build.zig @@ -6,19 +6,14 @@ fn path(comptime suffix: []const u8) []const u8 { return comptime (std.fs.path.dirname(@src().file) orelse ".") ++ std.fs.path.sep_str ++ suffix; } -pub fn link(exe: *CompileStep) void { - // create zig-network module - const b = exe.builder; - +pub fn getModule(b: *std.Build) *std.build.Module { // https://github.com/MasterQ32/zig-network const network = b.createModule(.{ .source_file = .{ .path = path("lib/zig-network/network.zig") } }); - const gdbstub = b.createModule(.{ + return b.createModule(.{ .source_file = .{ .path = path("src/lib.zig") }, .dependencies = &.{.{ .name = "network", .module = network }}, }); - - exe.addModule("gdbstub", gdbstub); } pub fn build(b: *std.Build) void {