https://github.com/doccaico/lexbor-zig
Zig build package and wrapper for Lexbor v2.4.0
https://github.com/doccaico/lexbor-zig
lexbor zig
Last synced: 10 months ago
JSON representation
Zig build package and wrapper for Lexbor v2.4.0
- Host: GitHub
- URL: https://github.com/doccaico/lexbor-zig
- Owner: doccaico
- Created: 2025-02-18T00:49:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-26T02:07:31.000Z (over 1 year ago)
- Last Synced: 2025-06-06T02:37:07.553Z (about 1 year ago)
- Topics: lexbor, zig
- Language: C
- Homepage:
- Size: 2.33 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### (WIP) lexbor-zig
Experimental Zig build package and wrapper for [Lexbor](https://github.com/lexbor/lexbor/) v2.4.0
Currently, it has only been tested on Windows.
#### Fetch
```
zig fetch --save=lexbor https://github.com/doccaico/lexbor-zig/archive/.tar.gz
```
#### Using as a single static library (it included all modules)
```zig
// 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);
}
```
#### Using individual modules (e.g. html module)
```zig
// 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](https://github.com/doccaico/lexbor-zig/blob/main/build.zig)
#### How to build a static library (it included all modules)
```
git clone https://github.com/doccaico/lexbor-zig
zig build
```
#### How to build static libraries separately (e.g. html module)
```
git clone https://github.com/doccaico/lexbor-zig
zig build -Dhtml
```