chore: update to the new build system
This commit is contained in:
parent
215e053b9a
commit
5996196647
40
build.zig
40
build.zig
|
@ -6,45 +6,17 @@ fn path(comptime suffix: []const u8) []const u8 {
|
||||||
return comptime (std.fs.path.dirname(@src().file) orelse ".") ++ std.fs.path.sep_str ++ suffix;
|
return comptime (std.fs.path.dirname(@src().file) orelse ".") ++ std.fs.path.sep_str ++ suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
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") } });
|
|
||||||
|
|
||||||
return b.createModule(.{
|
|
||||||
.source_file = .{ .path = path("src/lib.zig") },
|
|
||||||
.dependencies = &.{.{ .name = "network", .module = network }},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
pub fn build(b: *std.Build) void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
// const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
// -- Library --
|
const net_dep = b.dependency("zig-network", .{}); // https://github.com/MasterQ32/zig-network
|
||||||
|
_ = b.addModule("gdbstub", .{
|
||||||
const lib_test = b.addTest(.{
|
.source_file = .{ .path = "src/lib.zig" },
|
||||||
.root_source_file = .{ .path = "src/lib.zig" },
|
.dependencies = &.{.{ .name = "network", .module = net_dep.module("network") }},
|
||||||
.target = target,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const lib_test = b.addTest(.{ .root_source_file = .{ .path = "src/lib.zig" }, .target = target });
|
||||||
|
|
||||||
const test_step = b.step("test", "Run Library Tests");
|
const test_step = b.step("test", "Run Library Tests");
|
||||||
test_step.dependOn(&lib_test.step);
|
test_step.dependOn(&lib_test.step);
|
||||||
|
|
||||||
// -- Executable --
|
|
||||||
|
|
||||||
// const exe = b.addExecutable(.{
|
|
||||||
// .name = "gdbserver",
|
|
||||||
// .root_source_file = .{ .path = "src/main.zig" },
|
|
||||||
// .target = target,
|
|
||||||
// .optimize = optimize,
|
|
||||||
// });
|
|
||||||
// link(exe);
|
|
||||||
// exe.install();
|
|
||||||
|
|
||||||
// const run_cmd = exe.run();
|
|
||||||
// run_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
// if (b.args) |args| run_cmd.addArgs(args);
|
|
||||||
|
|
||||||
// const run_step = b.step("run", "Run the app");
|
|
||||||
// run_step.dependOn(&run_cmd.step);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
.{
|
||||||
|
.name = "zba-gdbstub",
|
||||||
|
.version = "0.1.0",
|
||||||
|
.dependencies = .{
|
||||||
|
.@"zig-network" = .{
|
||||||
|
.url = "https://github.com/MasterQ32/zig-network/archive/86c315be67c7567195cc426615d81202a39bbb91.tar.gz",
|
||||||
|
.hash = "1220746fef79fb9774d76a0a5d746ccf30cfc847bce4a3a7388c3451817b7ab92869",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in New Issue