add no-bin option as recommended in zig 0.14.0 rlease notes
https://ziglang.org/download/0.14.0/release-notes.html\#Incremental-Compilation
This commit is contained in:
parent
8421fd9e55
commit
e0e09fb19e
1 changed files with 12 additions and 8 deletions
20
build.zig
20
build.zig
|
@ -34,12 +34,12 @@ pub fn build(b: *Builder) !void {
|
||||||
"no-llvm",
|
"no-llvm",
|
||||||
"Disable LLVM",
|
"Disable LLVM",
|
||||||
) orelse false;
|
) orelse false;
|
||||||
|
|
||||||
const broken_windows = b.option(
|
const broken_windows = b.option(
|
||||||
bool,
|
bool,
|
||||||
"broken-windows",
|
"broken-windows",
|
||||||
"Windows is broken in this environment (do not run Windows tests)",
|
"Windows is broken in this environment (do not run Windows tests)",
|
||||||
) orelse false;
|
) orelse false;
|
||||||
|
const no_bin = b.option(bool, "no-bin", "skip emitting binary") orelse false;
|
||||||
// TODO: Embed the current git version in the code. We can do this
|
// TODO: Embed the current git version in the code. We can do this
|
||||||
// by looking for .git/HEAD (if it exists, follow the ref to /ref/heads/whatevs,
|
// by looking for .git/HEAD (if it exists, follow the ref to /ref/heads/whatevs,
|
||||||
// grab that commit, and use b.addOptions/exe.addOptions to generate the
|
// grab that commit, and use b.addOptions/exe.addOptions to generate the
|
||||||
|
@ -102,12 +102,12 @@ pub fn build(b: *Builder) !void {
|
||||||
var cg_cmd = b.addRunArtifact(cg_exe);
|
var cg_cmd = b.addRunArtifact(cg_exe);
|
||||||
cg_cmd.addArg("--models");
|
cg_cmd.addArg("--models");
|
||||||
cg_cmd.addArg(try std.fs.path.join(
|
cg_cmd.addArg(try std.fs.path.join(
|
||||||
b.allocator,
|
b.allocator,
|
||||||
&[_][]const u8{
|
&[_][]const u8{
|
||||||
try b.dependency("models", .{}).path("").getPath3(b, null).toString(b.allocator),
|
try b.dependency("models", .{}).path("").getPath3(b, null).toString(b.allocator),
|
||||||
models_subdir,
|
models_subdir,
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
cg_cmd.addArg("--output");
|
cg_cmd.addArg("--output");
|
||||||
const cg_output_dir = cg_cmd.addOutputDirectoryArg("src/models");
|
const cg_output_dir = cg_cmd.addOutputDirectoryArg("src/models");
|
||||||
if (b.verbose)
|
if (b.verbose)
|
||||||
|
@ -218,5 +218,9 @@ pub fn build(b: *Builder) !void {
|
||||||
const run_smoke_test = b.addRunArtifact(smoke_test);
|
const run_smoke_test = b.addRunArtifact(smoke_test);
|
||||||
|
|
||||||
smoke_test_step.dependOn(&run_smoke_test.step);
|
smoke_test_step.dependOn(&run_smoke_test.step);
|
||||||
b.installArtifact(exe);
|
if (no_bin) {
|
||||||
|
b.getInstallStep().dependOn(&exe.step);
|
||||||
|
} else {
|
||||||
|
b.installArtifact(exe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue