42 lines
1.2 KiB
Zig
42 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"));
|
|
|
|
const container = b.addExecutable(.{
|
|
.name = "container",
|
|
.root_source_file = b.path("examples/container.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
container.root_module.addImport("zterm", lib);
|
|
b.installArtifact(container);
|
|
|
|
// 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);
|
|
}
|