build.zig (762B)
1 const std = @import("std"); 2 3 pub fn build(b: *std.Build) !void { 4 const target = b.standardTargetOptions(.{}); 5 const optimize = b.standardOptimizeOption(.{}); 6 7 const lib = b.addLibrary(.{ 8 .name = "utf8proc", 9 .linkage = .static, 10 .root_module = b.createModule(.{ 11 .target = target, 12 .optimize = optimize, 13 }), 14 }); 15 16 if (b.lazyDependency("utf8proc", .{})) |upstream| { 17 lib.addIncludePath(upstream.path("")); 18 lib.installHeader(upstream.path("utf8proc.h"), "utf8proc.h"); 19 20 lib.linkLibC(); 21 22 lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{ 23 "utf8proc.c", 24 }, .flags = &.{"-DUTF8PROC_STATIC"} }); 25 } 26 27 b.installArtifact(lib); 28 }