summaryrefslogtreecommitdiff
path: root/vere/ext/whereami/build.zig
blob: 12419b24a14df99b7e23b1d16049e7573360fc1d (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
30
31
32
33
const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const dep_c = b.dependency("whereami", .{
        .target = target,
        .optimize = optimize,
    });

    const lib = b.addStaticLibrary(.{
        .name = "whereami",
        .target = target,
        .optimize = optimize,
    });

    lib.linkLibC();

    lib.addIncludePath(dep_c.path("src"));

    lib.addCSourceFiles(.{
        .root = dep_c.path("src"),
        .files = &.{"whereami.c"},
        .flags = &.{
            "-fno-sanitize=all",
        },
    });

    lib.installHeader(dep_c.path("src/whereami.h"), "whereami.h");

    b.installArtifact(lib);
}