From bbad2cbfd2b0a3811a359f280f8916966fbbd7bb Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 30 Aug 2026 11:39:10 +0200 Subject: [PATCH] Add minimal Zig build scripts Targets Zig 0.16 Compiles and installs a static library and headers for downstream projects (Zig or C) using `build.zig` build scripts. --- build.zig | 26 ++++++++++++++++++++++++++ build.zig.zon | 14 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 build.zig create mode 100644 build.zig.zon diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..85d7594 --- /dev/null +++ b/build.zig @@ -0,0 +1,26 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) !void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + var utf8proc = b.createModule(.{ + .target = target, + .optimize = optimize, + .link_libc = true, + }); + + const lib = b.addLibrary(.{ + .name = "utf8proc", + .linkage = .static, + .root_module = utf8proc, + }); + + lib.installHeader(b.path("utf8proc.h"), "utf8proc.h"); + + utf8proc.addCSourceFiles(.{ .root = b.path("."), .files = &.{ + "utf8proc.c", + }, .flags = &.{"-DUTF8PROC_STATIC"} }); + + b.installArtifact(lib); +} diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 0000000..a7f9f65 --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,14 @@ +.{ + .name = .utf8proc, + .fingerprint = 0xdcddf08dbb8954c4, + .version = "2.11.3", + .paths = .{ + "build.zig", + "build.zig.zon", + "utf8proc.h", + "utf8proc.c", + "utf8proc_data.c", + "README.md", + "LICENSE.md", + }, +}