Return an error if b.findProgram errors instead of just skipping
This commit is contained in:
parent
09f43674b5
commit
bc370573a8
1 changed files with 5 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const Scanner = @import("wayland").Scanner;
|
const Scanner = @import("wayland").Scanner;
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
pub fn build(b: *std.Build) !void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
|
|
@ -17,7 +17,10 @@ pub fn build(b: *std.Build) void {
|
||||||
"Set to true to build man pages. Requires scdoc. Defaults to true if scdoc is found.",
|
"Set to true to build man pages. Requires scdoc. Defaults to true if scdoc is found.",
|
||||||
) orelse scdoc_found: {
|
) orelse scdoc_found: {
|
||||||
// Default to true if scdoc is available; else false.
|
// Default to true if scdoc is available; else false.
|
||||||
_ = b.findProgram(&.{"scdoc"}, &.{}) catch break :scdoc_found false;
|
_ = b.findProgram(&.{"scdoc"}, &.{}) catch |err| switch (err) {
|
||||||
|
error.FileNotFound => break :scdoc_found false,
|
||||||
|
else => return err,
|
||||||
|
};
|
||||||
break :scdoc_found true;
|
break :scdoc_found true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue