summaryrefslogtreecommitdiff
path: root/vere/pkg/ur/build.zig
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
committerpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
commitfcedfddf00b3f994e4f4e40332ac7fc192c63244 (patch)
tree51d38e62c7bdfcc5f9a5e9435fe820c93cfc9a3d /vere/pkg/ur/build.zig
claude is gud
Diffstat (limited to 'vere/pkg/ur/build.zig')
-rw-r--r--vere/pkg/ur/build.zig42
1 files changed, 42 insertions, 0 deletions
diff --git a/vere/pkg/ur/build.zig b/vere/pkg/ur/build.zig
new file mode 100644
index 0000000..abd1ec0
--- /dev/null
+++ b/vere/pkg/ur/build.zig
@@ -0,0 +1,42 @@
+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 &.{};
+
+ const pkg_ur = b.addStaticLibrary(.{
+ .name = "ur",
+ .target = target,
+ .optimize = optimize,
+ });
+
+ const murmur3 = b.dependency("murmur3", .{
+ .target = target,
+ .optimize = optimize,
+ });
+
+ pkg_ur.linkLibC();
+ pkg_ur.linkLibrary(murmur3.artifact("murmur3"));
+
+ pkg_ur.addIncludePath(b.path(""));
+ pkg_ur.addCSourceFiles(.{
+ .root = b.path(""),
+ .files = &.{
+ "bitstream.c",
+ "hashcons.c",
+ "serial.c",
+ },
+ .flags = copts,
+ });
+
+ pkg_ur.installHeader(b.path("bitstream.h"), "ur/bitstream.h");
+ pkg_ur.installHeader(b.path("defs.h"), "ur/defs.h");
+ pkg_ur.installHeader(b.path("hashcons.h"), "ur/hashcons.h");
+ pkg_ur.installHeader(b.path("serial.h"), "ur/serial.h");
+ pkg_ur.installHeader(b.path("ur.h"), "ur/ur.h");
+
+ b.installArtifact(pkg_ur);
+}