summaryrefslogtreecommitdiff
path: root/vere/ext/pdjson
diff options
context:
space:
mode:
Diffstat (limited to 'vere/ext/pdjson')
-rw-r--r--vere/ext/pdjson/build.zig38
-rw-r--r--vere/ext/pdjson/build.zig.zon14
2 files changed, 52 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..28febf8
--- /dev/null
+++ b/vere/ext/pdjson/build.zig.zon
@@ -0,0 +1,14 @@
+.{
+ .name = .pdjson,
+ .version = "0.0.1",
+ .fingerprint = 0x9c1187b6fa1266aa,
+ .dependencies = .{
+ .pdjson = .{
+ .url = "https://github.com/skeeto/pdjson/archive/67108d883061043e55d0fb13961ac1b6fc8a485c.tar.gz",
+ .hash = "N-V-__8AADC9AACneJx7RTm9Hui7GCYJ2Qdv8Z_CUCbJphyi",
+ },
+ },
+ .paths = .{
+ "",
+ },
+}