zba-gdbstub/build.zig

23 lines
865 B
Zig

const std = @import("std");
const CompileStep = std.Build.CompileStep;
fn path(comptime suffix: []const u8) []const u8 {
if (suffix[0] == '/') @compileError("expected a relative path");
return comptime (std.fs.path.dirname(@src().file) orelse ".") ++ std.fs.path.sep_str ++ suffix;
}
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const net_dep = b.dependency("zig-network", .{}); // https://github.com/MasterQ32/zig-network
_ = b.addModule("gdbstub", .{
.source_file = .{ .path = "src/lib.zig" },
.dependencies = &.{.{ .name = "network", .module = net_dep.module("network") }},
});
const lib_test = b.addTest(.{ .root_source_file = .{ .path = "src/lib.zig" }, .target = target });
const test_step = b.step("test", "Run Library Tests");
test_step.dependOn(&lib_test.step);
}