add(example): input with simple text field
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m41s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m41s
This commit is contained in:
21
build.zig
21
build.zig
@@ -5,6 +5,7 @@ pub fn build(b: *std.Build) void {
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const Examples = enum {
|
||||
Input,
|
||||
Layout,
|
||||
Scrollable,
|
||||
};
|
||||
@@ -28,14 +29,14 @@ pub fn build(b: *std.Build) void {
|
||||
});
|
||||
lib.addImport("code_point", zg.module("code_point"));
|
||||
|
||||
// Examples.Scrollable
|
||||
const scrollable = b.addExecutable(.{
|
||||
.name = "scrollable",
|
||||
.root_source_file = b.path("examples/scrollable.zig"),
|
||||
// Examples.Input
|
||||
const input = b.addExecutable(.{
|
||||
.name = "input",
|
||||
.root_source_file = b.path("examples/input.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
scrollable.root_module.addImport("zterm", lib);
|
||||
input.root_module.addImport("zterm", lib);
|
||||
|
||||
// Examples.Layout
|
||||
const layout = b.addExecutable(.{
|
||||
@@ -46,8 +47,18 @@ pub fn build(b: *std.Build) void {
|
||||
});
|
||||
layout.root_module.addImport("zterm", lib);
|
||||
|
||||
// Examples.Scrollable
|
||||
const scrollable = b.addExecutable(.{
|
||||
.name = "scrollable",
|
||||
.root_source_file = b.path("examples/scrollable.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
scrollable.root_module.addImport("zterm", lib);
|
||||
|
||||
// mapping of user selected example to compile step
|
||||
const exe = switch (example) {
|
||||
.Input => input,
|
||||
.Layout => layout,
|
||||
.Scrollable => scrollable,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user