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:
parent
ad0b4ef764
commit
2f4a29505c
1 changed files with 9 additions and 1 deletions
10
build.zig
10
build.zig
|
@ -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: {
|
||||
|
|
Loading…
Add table
Reference in a new issue