chore: replace link() with getModule()

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-03-19 20:42:05 -05:00
parent acb59994fc
commit 215e053b9a
1 changed files with 2 additions and 7 deletions

View File

@ -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 {