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/natpmp/build.zig | |
working
Diffstat (limited to 'vere/ext/natpmp/build.zig')
| -rw-r--r-- | vere/ext/natpmp/build.zig | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vere/ext/natpmp/build.zig b/vere/ext/natpmp/build.zig new file mode 100644 index 0000000..2a44dee --- /dev/null +++ b/vere/ext/natpmp/build.zig @@ -0,0 +1,37 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const lib = b.addStaticLibrary(.{ + .name = "natpmp", + .target = target, + .optimize = optimize, + }); + + const dep_c = b.dependency("natpmp", .{ + .target = target, + .optimize = optimize, + }); + + lib.addIncludePath(dep_c.path("include")); + + lib.addCSourceFiles(.{ + .root = dep_c.path(""), + .files = &.{ + "natpmp.c", + "getgateway.c", + }, + .flags = &.{ + "-fno-sanitize=all", + }, + }); + + lib.installHeader(dep_c.path("natpmp.h"), "natpmp.h"); + lib.installHeader(dep_c.path("getgateway.h"), "getgateway.h"); + lib.installHeader(dep_c.path("natpmp_declspec.h"), "natpmp_declspec.h"); + + lib.linkLibC(); + b.installArtifact(lib); +} |
