diff options
| author | polwex <polwex@sortug.com> | 2025-10-06 01:01:41 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-06 01:01:41 +0700 |
| commit | c4b392a179048f936c062f5ffccc2bc25627e500 (patch) | |
| tree | 09be0904be8ec4d7ea52992ef7580d42ed0c28c1 /vere/ext/pdjson | |
working
Diffstat (limited to 'vere/ext/pdjson')
| -rw-r--r-- | vere/ext/pdjson/build.zig | 38 | ||||
| -rw-r--r-- | vere/ext/pdjson/build.zig.zon | 13 |
2 files changed, 51 insertions, 0 deletions
diff --git a/vere/ext/pdjson/build.zig b/vere/ext/pdjson/build.zig new file mode 100644 index 0000000..5e851bb --- /dev/null +++ b/vere/ext/pdjson/build.zig @@ -0,0 +1,38 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const dep_c = b.dependency("pdjson", .{ + .target = target, + .optimize = optimize, + }); + + const lib = b.addStaticLibrary(.{ + .name = "pdjson", + .target = target, + .optimize = optimize, + }); + + lib.linkLibC(); + + lib.addIncludePath(dep_c.path(".")); + + lib.addCSourceFiles(.{ + .root = dep_c.path("."), + .files = &.{"pdjson.c"}, + .flags = &.{ + "-fno-sanitize=all", + "-std=c99", + "-pedantic", + "-Wall", + "-Wextra", + "-Wno-missing-field-initializers", + }, + }); + + lib.installHeader(dep_c.path("pdjson.h"), "pdjson.h"); + + b.installArtifact(lib); +} diff --git a/vere/ext/pdjson/build.zig.zon b/vere/ext/pdjson/build.zig.zon new file mode 100644 index 0000000..1774d5b --- /dev/null +++ b/vere/ext/pdjson/build.zig.zon @@ -0,0 +1,13 @@ +.{ + .name = "pdjson", + .version = "0.0.1", + .dependencies = .{ + .pdjson = .{ + .url = "https://github.com/skeeto/pdjson/archive/67108d883061043e55d0fb13961ac1b6fc8a485c.tar.gz", + .hash = "N-V-__8AADC9AACneJx7RTm9Hui7GCYJ2Qdv8Z_CUCbJphyi", + }, + }, + .paths = .{ + "", + }, +} |
