Files
neovim/deps/utf8proc/build.zig
Chinmay Dalal 6d9031390c feat(build.zig): add option to use system dependencies
Problem:
build.zig always downloads dependencies and statically links them,
which is frowned upon by distro packagers.

Solution:
Add option to use system libraries.
2026-01-13 22:09:03 -05:00

29 lines
762 B
Zig

const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const lib = b.addLibrary(.{
.name = "utf8proc",
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
if (b.lazyDependency("utf8proc", .{})) |upstream| {
lib.addIncludePath(upstream.path(""));
lib.installHeader(upstream.path("utf8proc.h"), "utf8proc.h");
lib.linkLibC();
lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
"utf8proc.c",
}, .flags = &.{"-DUTF8PROC_STATIC"} });
}
b.installArtifact(lib);
}