Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

40
packages/zig/build.zig generated Normal file
View File

@@ -0,0 +1,40 @@
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Default library/include search paths follow the conventional Cargo workspace
// layout (`<workspace>/target/{profile}` and the FFI crate's `include/` dir).
// Override with `-Dffi_path=...` and `-Dffi_include_path=...` if your layout differs.
// `alef publish` rewrites this file for the distributed tarball so consumers
// link the bundled `lib/` + `include/` shipped alongside the package instead.
const ffi_path = b.option([]const u8, "ffi_path", "Path to directory containing libkreuzberg_ffi.{dylib,so,dll,a}") orelse "../../target/release";
const ffi_include = b.option([]const u8, "ffi_include_path", "Path to directory containing the FFI C header") orelse "../../crates/kreuzberg-ffi/include";
const module = b.addModule("kreuzberg", .{
.root_source_file = b.path("src/kreuzberg.zig"),
.target = target,
.optimize = optimize,
});
module.addLibraryPath(.{ .cwd_relative = ffi_path });
module.addIncludePath(.{ .cwd_relative = ffi_include });
module.linkSystemLibrary("kreuzberg_ffi", .{});
const test_module = b.createModule(.{
.root_source_file = b.path("src/kreuzberg.zig"),
.target = target,
.optimize = optimize,
});
test_module.addLibraryPath(.{ .cwd_relative = ffi_path });
test_module.addIncludePath(.{ .cwd_relative = ffi_include });
test_module.linkSystemLibrary("kreuzberg_ffi", .{});
const tests = b.addTest(.{
.root_module = test_module,
});
const run_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_tests.step);
}