Wuffs file loading library packaged for zig
For zig 0.13.0, packages wuffs version 0.4.0-alpha.9+3837.20240914
zig fetch --save=wuffs git+https://github.com/allyourcodebase/wuffs
Then, choose one:
build.zig:
const wuffs = b.dependency("wuffs", .{.target = target, .optimize = optimize});
exe.linkLibrary(wuffs.artifact("wuffs"));
c:
#include <wuffs.h>
build.zig:
const wuffs = b.dependency("wuffs", .{.target = target, .optimize = optimize});
exe.root_module.addImport("wuffs", wuffs.module("wuffs"));
zig:
const wuffs = @import("wuffs");
build.zig:
const wuffs = b.dependency("wuffs", .{.target = target, .optimize = optimize});
exe.addIncludePath(wuffs.b.dependency("wuffs", .{}).path("release/c"));
c:
#define WUFFS_CONFIG__STATIC_FUNCTIONS
#define WUFFS_IMPLEMENTATION
#include <wuffs-v0.4.c>
// wuffs functions can be used in this file only and do not leak any symbols outside this file
This package is for using the wuffs standard library. It downloads a prebuilt .c
file, and does not package the wuffs compiler itself for use with zig.