add(examples/errors): error notifaction handling
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m33s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m33s
This commit is contained in:
13
build.zig
13
build.zig
@@ -17,6 +17,8 @@ pub fn build(b: *std.Build) void {
|
||||
// styles:
|
||||
text,
|
||||
palette,
|
||||
// error handling
|
||||
errors,
|
||||
};
|
||||
|
||||
const example = b.option(Examples, "example", "Example to build and/or run. (default: vertical)") orelse .vertical;
|
||||
@@ -115,6 +117,15 @@ pub fn build(b: *std.Build) void {
|
||||
});
|
||||
text.root_module.addImport("zterm", lib);
|
||||
|
||||
// error handling:
|
||||
const errors = b.addExecutable(.{
|
||||
.name = "errors",
|
||||
.root_source_file = b.path("examples/errors.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
errors.root_module.addImport("zterm", lib);
|
||||
|
||||
// mapping of user selected example to compile step
|
||||
const exe = switch (example) {
|
||||
// elements:
|
||||
@@ -129,6 +140,8 @@ pub fn build(b: *std.Build) void {
|
||||
// styles:
|
||||
.text => text,
|
||||
.palette => palette,
|
||||
// error handling:
|
||||
.errors => errors,
|
||||
};
|
||||
b.installArtifact(exe);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user