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:
23
build.zig
23
build.zig
@@ -46,9 +46,11 @@ pub fn build(b: *std.Build) void {
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.target = target,
|
||||
.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 ---
|
||||
const examples = std.meta.fields(Examples);
|
||||
@@ -56,6 +58,7 @@ pub fn build(b: *std.Build) void {
|
||||
if (@as(Examples, @enumFromInt(e.value)) == .all) continue; // skip `.all` entry
|
||||
const demo = b.addExecutable(.{
|
||||
.name = e.name,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path(switch (@as(Examples, @enumFromInt(e.value))) {
|
||||
.demo => "examples/demo.zig",
|
||||
.continuous => "examples/continuous.zig",
|
||||
@@ -81,22 +84,28 @@ pub fn build(b: *std.Build) void {
|
||||
}),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "zterm", .module = lib },
|
||||
},
|
||||
}),
|
||||
});
|
||||
// import dependencies
|
||||
demo.root_module.addImport("zterm", lib);
|
||||
// mapping of user selected example to compile step
|
||||
if (@intFromEnum(example) == e.value or example == .all) b.installArtifact(demo);
|
||||
}
|
||||
|
||||
// zig build test
|
||||
const lib_unit_tests = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user