diff options
| author | coast <coasteen@proton.me> | 2026-10-10 22:13:10 +0330 |
|---|---|---|
| committer | coast <coasteen@proton.me> | 2026-10-10 22:13:10 +0330 |
| commit | dcb8bef3ed7b3adcdb54fcd0cd5a4065091019a7 (patch) | |
| tree | c39a3d069f83ec258a956fc902e6149915cd4cb2 /build.zig | |
| download | zigmatrix-dcb8bef3ed7b3adcdb54fcd0cd5a4065091019a7.tar.gz zigmatrix-dcb8bef3ed7b3adcdb54fcd0cd5a4065091019a7.tar.bz2 zigmatrix-dcb8bef3ed7b3adcdb54fcd0cd5a4065091019a7.tar.xz zigmatrix-dcb8bef3ed7b3adcdb54fcd0cd5a4065091019a7.tar.zst | |
init
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..e63b04e --- /dev/null +++ b/build.zig @@ -0,0 +1,34 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.option( + std.builtin.OptimizeMode, + "optimize", + "Optimization mode (default: ReleaseFast)", + ) orelse .ReleaseFast; + + const exe = b.addExecutable(.{ + .name = "zigmatrix", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + .strip = true, + .single_threaded = true, + .link_libc = true, + }), + }); + exe.root_module.addCSourceFile(.{ + .file = b.path("src/term.c"), + .flags = &.{"-O2"}, + }); + b.installArtifact(exe); + + const run_cmd = b.addRunArtifact(exe); + run_cmd.step.dependOn(b.getInstallStep()); + if (b.args) |args| run_cmd.addArgs(args); + + const run_step = b.step("run", "Run zigmatrix"); + run_step.dependOn(&run_cmd.step); +} |
