chor: update zig version
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m3s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m3s
This commit is contained in:
77
build.zig
77
build.zig
@@ -46,9 +46,11 @@ pub fn build(b: *std.Build) void {
|
|||||||
.root_source_file = b.path("src/root.zig"),
|
.root_source_file = b.path("src/root.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
|
.imports = &.{
|
||||||
|
.{ .name = "code_point", .module = zg.module("code_point") },
|
||||||
|
.{ .name = "build_options", .module = options_module },
|
||||||
|
},
|
||||||
});
|
});
|
||||||
lib.addImport("code_point", zg.module("code_point"));
|
|
||||||
lib.addImport("build_options", options_module);
|
|
||||||
|
|
||||||
//--- Examples ---
|
//--- Examples ---
|
||||||
const examples = std.meta.fields(Examples);
|
const examples = std.meta.fields(Examples);
|
||||||
@@ -56,47 +58,54 @@ pub fn build(b: *std.Build) void {
|
|||||||
if (@as(Examples, @enumFromInt(e.value)) == .all) continue; // skip `.all` entry
|
if (@as(Examples, @enumFromInt(e.value)) == .all) continue; // skip `.all` entry
|
||||||
const demo = b.addExecutable(.{
|
const demo = b.addExecutable(.{
|
||||||
.name = e.name,
|
.name = e.name,
|
||||||
.root_source_file = b.path(switch (@as(Examples, @enumFromInt(e.value))) {
|
.root_module = b.createModule(.{
|
||||||
.demo => "examples/demo.zig",
|
.root_source_file = b.path(switch (@as(Examples, @enumFromInt(e.value))) {
|
||||||
.continuous => "examples/continuous.zig",
|
.demo => "examples/demo.zig",
|
||||||
// elements:
|
.continuous => "examples/continuous.zig",
|
||||||
.alignment => "examples/elements/alignment.zig",
|
// elements:
|
||||||
.button => "examples/elements/button.zig",
|
.alignment => "examples/elements/alignment.zig",
|
||||||
.input => "examples/elements/input.zig",
|
.button => "examples/elements/button.zig",
|
||||||
.progress => "examples/elements/progress.zig",
|
.input => "examples/elements/input.zig",
|
||||||
.radio_button => "examples/elements/radio-button.zig",
|
.progress => "examples/elements/progress.zig",
|
||||||
.scrollable => "examples/elements/scrollable.zig",
|
.radio_button => "examples/elements/radio-button.zig",
|
||||||
.selection => "examples/elements/selection.zig",
|
.scrollable => "examples/elements/scrollable.zig",
|
||||||
// layouts:
|
.selection => "examples/elements/selection.zig",
|
||||||
.vertical => "examples/layouts/vertical.zig",
|
// layouts:
|
||||||
.horizontal => "examples/layouts/horizontal.zig",
|
.vertical => "examples/layouts/vertical.zig",
|
||||||
.grid => "examples/layouts/grid.zig",
|
.horizontal => "examples/layouts/horizontal.zig",
|
||||||
.mixed => "examples/layouts/mixed.zig",
|
.grid => "examples/layouts/grid.zig",
|
||||||
// styles:
|
.mixed => "examples/layouts/mixed.zig",
|
||||||
.text => "examples/styles/text.zig",
|
// styles:
|
||||||
.palette => "examples/styles/palette.zig",
|
.text => "examples/styles/text.zig",
|
||||||
// error handling
|
.palette => "examples/styles/palette.zig",
|
||||||
.errors => "examples/errors.zig",
|
// error handling
|
||||||
.all => unreachable, // should never happen
|
.errors => "examples/errors.zig",
|
||||||
|
.all => unreachable, // should never happen
|
||||||
|
}),
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
.imports = &.{
|
||||||
|
.{ .name = "zterm", .module = lib },
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
});
|
});
|
||||||
// import dependencies
|
|
||||||
demo.root_module.addImport("zterm", lib);
|
|
||||||
// mapping of user selected example to compile step
|
// mapping of user selected example to compile step
|
||||||
if (@intFromEnum(example) == e.value or example == .all) b.installArtifact(demo);
|
if (@intFromEnum(example) == e.value or example == .all) b.installArtifact(demo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// zig build test
|
// zig build test
|
||||||
const lib_unit_tests = b.addTest(.{
|
const lib_unit_tests = b.addTest(.{
|
||||||
.root_source_file = b.path("src/root.zig"),
|
.root_module = b.createModule(.{
|
||||||
.target = target,
|
.root_source_file = b.path("src/root.zig"),
|
||||||
.optimize = optimize,
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
.imports = &.{
|
||||||
|
.{ .name = "code_point", .module = zg.module("code_point") },
|
||||||
|
.{ .name = "DisplayWidth", .module = zg.module("DisplayWidth") },
|
||||||
|
.{ .name = "build_options", .module = options_module },
|
||||||
|
},
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
lib_unit_tests.root_module.addImport("code_point", zg.module("code_point"));
|
|
||||||
lib_unit_tests.root_module.addImport("DisplayWidth", zg.module("DisplayWidth"));
|
|
||||||
lib_unit_tests.root_module.addImport("build_options", options_module);
|
|
||||||
|
|
||||||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user