From fcedfddf00b3f994e4f4e40332ac7fc192c63244 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 5 Oct 2025 21:56:51 +0700 Subject: claude is gud --- vere/pkg/ent/build.zig | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 vere/pkg/ent/build.zig (limited to 'vere/pkg/ent/build.zig') diff --git a/vere/pkg/ent/build.zig b/vere/pkg/ent/build.zig new file mode 100644 index 0000000..97b3c4e --- /dev/null +++ b/vere/pkg/ent/build.zig @@ -0,0 +1,43 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) !void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const t = target.result; + + 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"); + + if (t.os.tag == .windows) { + pkg_ent.linkSystemLibrary("bcrypt"); + } + + b.installArtifact(pkg_ent); +} -- cgit v1.2.3