summaryrefslogtreecommitdiff
path: root/vere/pkg/ent/build.zig
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 01:01:41 +0700
committerpolwex <polwex@sortug.com>2025-10-06 01:01:41 +0700
commitc4b392a179048f936c062f5ffccc2bc25627e500 (patch)
tree09be0904be8ec4d7ea52992ef7580d42ed0c28c1 /vere/pkg/ent/build.zig
working
Diffstat (limited to 'vere/pkg/ent/build.zig')
-rw-r--r--vere/pkg/ent/build.zig37
1 files changed, 37 insertions, 0 deletions
diff --git a/vere/pkg/ent/build.zig b/vere/pkg/ent/build.zig
new file mode 100644
index 0000000..5fd1308
--- /dev/null
+++ b/vere/pkg/ent/build.zig
@@ -0,0 +1,37 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) !void {
+ const target = b.standardTargetOptions(.{});
+ const optimize = b.standardOptimizeOption(.{});
+
+ const copts: []const []const u8 =
+ b.option([]const []const u8, "copt", "") orelse &.{};
+
+ var flags = std.ArrayList([]const u8).init(b.allocator);
+ defer flags.deinit();
+ try flags.appendSlice(&.{
+ "-pedantic",
+ "-std=gnu99",
+ });
+ try flags.appendSlice(copts);
+
+ const pkg_ent = b.addStaticLibrary(.{
+ .name = "ent",
+ .target = target,
+ .optimize = optimize,
+ });
+
+ pkg_ent.linkLibC();
+
+ pkg_ent.addIncludePath(b.path(""));
+
+ pkg_ent.addCSourceFiles(.{
+ .root = b.path(""),
+ .files = &.{"ent.c"},
+ .flags = flags.items,
+ });
+
+ pkg_ent.installHeader(b.path("ent.h"), "ent/ent.h");
+
+ b.installArtifact(pkg_ent);
+}