Experimental Zig build package and wrapper for Lexbor v2.4.0
Currently, it has only been tested on Windows.
zig fetch --save=lexbor https://github.com/doccaico/lexbor-zig/archive/<git-commit-hash>.tar.gz
// build.zig
// const exe = b.addExecutable(.{
// ...
const lexbor = b.dependency("lexbor", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("lexbor", lexbor.module("lexbor"));
// src/main.zig
const std = @import("std");
const core = @import("lexbor").core;
pub fn main() !void {
const array = core.array.create();
const status = core.array.init(array, 32);
try std.testing.expectEqual(status, .ok);
_ = core.array.destroy(array, true);
}
// build.zig
// const exe = b.addExecutable(.{
// ...
const lexbor = b.dependency("lexbor", .{
.target = target,
.optimize = optimize,
.html = true,
});
exe.root_module.addImport("lexbor", lexbor.module("lexbor"));
See more options: build.zig
git clone https://github.com/doccaico/lexbor-zig
zig build
git clone https://github.com/doccaico/lexbor-zig
zig build -Dhtml