fix: make dependency path strings relative
This commit is contained in:
parent
6467fc25e7
commit
08bf0f9201
|
@ -1,18 +1,23 @@
|
|||
const std = @import("std");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
const pkgs = struct {
|
||||
const Pkg = std.build.Pkg;
|
||||
|
||||
pub const gdbstub: Pkg = .{
|
||||
.name = "gdbstub",
|
||||
.source = .{ .path = "src/lib.zig" },
|
||||
.source = .{ .path = path("src/lib.zig") },
|
||||
.dependencies = &[_]Pkg{network},
|
||||
};
|
||||
|
||||
// https://github.com/MasterQ32/zig-network
|
||||
pub const network: Pkg = .{
|
||||
.name = "network",
|
||||
.source = .{ .path = "lib/zig-network/network.zig" },
|
||||
.source = .{ .path = path("lib/zig-network/network.zig") },
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue