Files
zterm/build.zig
Yves Biener bdbe05c996 mod(structure): update project structure
Remove examples, add description for design goals in README.md and
apply re-names and naming changes accordingly for the project structure.
Implement a flat hierachry, as the library shall remain pretty simple.
2025-01-30 23:02:34 +01:00

43 lines
1.2 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zg = b.dependency("zg", .{
.target = target,
.optimize = optimize,
});
// library
const lib = b.addModule("zterm", .{
.root_source_file = b.path("src/zterm.zig"),
.target = target,
.optimize = optimize,
});
lib.addImport("code_point", zg.module("code_point"));
// TODO: examples (not yet available)
// const stack_example = b.addExecutable(.{
// .name = "stack",
// .root_source_file = b.path("examples/stack.zig"),
// .target = target,
// .optimize = optimize,
// });
// stack_example.root_module.addImport("zterm", lib);
// b.installArtifact(stack_example);
// testing
const lib_unit_tests = b.addTest(.{
.root_source_file = b.path("src/zterm.zig"),
.target = target,
.optimize = optimize,
});
lib_unit_tests.root_module.addImport("code_point", zg.module("code_point"));
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_lib_unit_tests.step);
}