-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
31 lines (26 loc) · 952 Bytes
/
build.zig
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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const wuffs_dep = b.dependency("wuffs", .{});
const wuffs_lib = b.addStaticLibrary(.{
.name = "wuffs",
.target = target,
.optimize = optimize,
.link_libc = true,
});
wuffs_lib.addCSourceFile(.{
.file = wuffs_dep.path("release/c/wuffs-v0.4.c"),
.flags = &.{"-DWUFFS_IMPLEMENTATION"},
});
wuffs_lib.installHeader(wuffs_dep.path("release/c/wuffs-v0.4.c"), "wuffs.h");
b.installArtifact(wuffs_lib);
const wuffs_translatec = b.addTranslateC(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.root_source_file = wuffs_dep.path("release/c/wuffs-v0.4.c"),
});
const wuffs_mod = wuffs_translatec.addModule("wuffs");
wuffs_mod.linkLibrary(wuffs_lib);
}