Zig build system
Some checks failed
Demo / Explore-CI (push) Has been cancelled

This commit is contained in:
Imbus 2024-05-06 15:06:25 +02:00
parent 263cb19258
commit dd3e38c8dd
2 changed files with 23 additions and 0 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@
build
release
docs
zig-out
zig-cache

21
build.zig Normal file
View file

@ -0,0 +1,21 @@
const std = @import("std");
// Compile our C source with zig
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast });
const exe = b.addExecutable(.{
.name = "ctree",
.target = target,
.optimize = optimize,
.strip = true,
});
const sources = &.{ "src/main.c", "src/tree.c" };
exe.linkLibC();
exe.addCSourceFiles(.{ .files = sources });
b.installArtifact(exe);
}