tomlc17

tomlc17

tomlc17 on the Zig Build System.

Usage

Add this package to build.zig.zon:

zig fetch --save git+https://github.com/KNnut/tomlc17

And then import tomlc17 in build.zig with:

const tomlc17_dep = b.dependency("tomlc17", .{
    .target = target,
    .optimize = optimize,
});
const tomlc17_artifact = tomlc17_dep.artifact("tomlc17");
exe.root_module.linkLibrary(tomlc17_artifact);

const wf = b.addWriteFiles();
const translate_c = b.addTranslateC(.{
    .root_source_file = wf.add("c.h",
        \\#include <tomlc17.h>
    ),
    .target = target,
    .optimize = optimize,
});
translate_c.addIncludePath(tomlc17_artifact.getEmittedIncludeTree());
exe.root_module.addImport("c", translate_c.createModule());