1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

build.zig : addZap for use in other projects

This commit is contained in:
Rene Schallner 2023-01-13 17:49:42 +01:00
parent ad0b4ef764
commit 2f4a29505c

View file

@ -47,7 +47,7 @@ pub fn build(b: *std.build.Builder) !void {
var example = b.addExecutable(ex_name, ex_src);
example.setBuildMode(mode);
example.addPackage(zap);
_ = try addFacilio(example, "./");
try addFacilio(example, "./");
const example_run = example.run();
example_run_step.dependOn(&example_run.step);
@ -111,6 +111,14 @@ pub fn addFacilio(exe: *std.build.LibExeObjStep, comptime p: [*]const u8) !void
}, flags.items);
}
pub fn addZap(exe: *std.build.LibExeObjStep, comptime p: [*]const u8) !void {
try addFacilio(exe, p);
var b = exe.builder;
var ensure_step = b.step("zap-deps", "ensure zap's dependencies");
ensure_step.makeFn = ensureDeps;
exe.step.dependOn(ensure_step);
}
fn sdkPath(comptime suffix: []const u8) []const u8 {
if (suffix[0] != '/') @compileError("suffix must be an absolute path");
return comptime blk: {