summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-09 20:31:09 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit4b5e793f48f6e721c39ab6ddcf755604df73b643 (patch)
treef3cf8b009bbfbd5667635381f0f624cd6b466084 /build.zig
parent9085cb5bfdd0b78ff3a62c0c71fc231dd7b5052a (diff)
downloadpardes-4b5e793f48f6e721c39ab6ddcf755604df73b643.tar.gz
pardes-4b5e793f48f6e721c39ab6ddcf755604df73b643.zip
Better text rendering
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig18
1 files changed, 11 insertions, 7 deletions
diff --git a/build.zig b/build.zig
index e399f537..84accf93 100644
--- a/build.zig
+++ b/build.zig
@@ -532,10 +532,9 @@ pub fn build(b: *std.Build) void {
root_mod.addOptions("pardes_config", opts);
hx_core_mod.addOptions("pardes_config", opts);
- // SDL3 shell wiring (-Dplatform=gui). The sdl package builds SDL3
- // from source as a static lib + emits the SDL3/ headers; gui.zig @cImports
- // those, plus a small stb_truetype C shim for the glyph atlas, and embeds
- // the SPIR-V compiled at build time from shaders/*.glsl.
+ // SDL3 shell wiring (-Dplatform=gui). SDL3 and FreeType are both built
+ // from source as static libraries; gui.zig @cImports their headers plus
+ // the small FreeType policy shim, and embeds SPIR-V compiled from GLSL.
if (platform == .gui) {
// sanitize_c MUST stay off: zig cc's UBSan (on for C in Debug AND
// ReleaseSafe) traps hidapi's mismatched fn-pointer calls the moment
@@ -549,15 +548,20 @@ pub fn build(b: *std.Build) void {
root_mod.linkLibrary(sdl_lib);
root_mod.addIncludePath(dep.path("include"));
}
+ const freetype_dep = b.dependency("freetype", .{
+ .target = target,
+ .optimize = optimize,
+ .@"enable-libpng" = false,
+ });
+ root_mod.linkLibrary(freetype_dep.artifact("freetype"));
// darwin: SDL_GPU only speaks SPIRV here (shaders/*.glsl -> glslc), so
// it must pick its vulkan backend via the Vulkan SDK's loader +
// MoltenVK in /usr/local/lib — a path dyld no longer searches for
// bare dlopen names. The rpath restores that lookup.
if (target.result.os.tag.isDarwin())
root_mod.addRPath(.{ .cwd_relative = "/usr/local/lib" });
- root_mod.addIncludePath(b.path("vendor/stb"));
- root_mod.addCSourceFile(.{ .file = b.path("vendor/stb/stb_truetype_impl.c") });
- root_mod.addCSourceFile(.{ .file = b.path("vendor/stb/font.c") });
+ root_mod.addIncludePath(b.path("src/gui"));
+ root_mod.addCSourceFile(.{ .file = b.path("src/gui/font.c") });
// the embedded UI font: provided as a build import since assets/ lives
// outside the src/ module root (@embedFile can't escape it)
root_mod.addAnonymousImport("AdwaitaMono-Regular.ttf", .{