summaryrefslogtreecommitdiffstatshomepage
path: root/deps/utf8proc/build.zig
blob: c9be9f3c7e10d8e29cacbc7eb73312a40f02120e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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| {
        var root_module = lib.root_module;
        root_module.addIncludePath(upstream.path(""));
        lib.installHeader(upstream.path("utf8proc.h"), "utf8proc.h");

        root_module.link_libc = true;

        root_module.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
            "utf8proc.c",
        }, .flags = &.{"-DUTF8PROC_STATIC"} });
    }

    b.installArtifact(lib);
}