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