earcut: new industrial-strength polygon triangulation library

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-10-30 05:44:16 -07:00
parent 839d60c940
commit 09fa494359
12 changed files with 1148 additions and 0 deletions

25
libs/earcut/build.zig Normal file
View file

@ -0,0 +1,25 @@
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addStaticLibrary("earcut", "src/main.zig");
lib.setBuildMode(mode);
lib.install();
var main_tests = b.addTest("src/main.zig");
main_tests.setBuildMode(mode);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
_ = pkg;
}
pub const pkg = std.build.Pkg{
.name = "earcut",
.source = .{ .path = thisDir() ++ "/src/main.zig" },
};
fn thisDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}