diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-04-04 19:22:04 +0300 |
|---|---|---|
| committer | Can Celik <ogulcancelik@gmail.com> | 2026-04-05 01:23:06 +0300 |
| commit | 41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch) | |
| tree | 3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/pkg/wuffs/build.zig | |
| parent | 55c138263e190a1e79d4b997bfb9397306c0ec1f (diff) | |
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/pkg/wuffs/build.zig')
| -rw-r--r-- | vendor/libghostty-vt/pkg/wuffs/build.zig | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/pkg/wuffs/build.zig b/vendor/libghostty-vt/pkg/wuffs/build.zig new file mode 100644 index 00000000..3d9f83da --- /dev/null +++ b/vendor/libghostty-vt/pkg/wuffs/build.zig @@ -0,0 +1,53 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) !void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const module = b.addModule("wuffs", .{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + .link_libc = true, + }); + + const unit_tests = b.addTest(.{ + .name = "test", + .root_module = module, + }); + unit_tests.linkLibC(); + + var flags: std.ArrayList([]const u8) = .empty; + defer flags.deinit(b.allocator); + try flags.append(b.allocator, "-DWUFFS_IMPLEMENTATION"); + inline for (@import("src/c.zig").defines) |key| { + try flags.append(b.allocator, "-D" ++ key); + } + + if (b.lazyDependency("wuffs", .{})) |wuffs_dep| { + module.addIncludePath(wuffs_dep.path("release/c")); + module.addCSourceFile(.{ + .file = wuffs_dep.path("release/c/wuffs-v0.4.c"), + .flags = flags.items, + }); + } + + if (b.lazyDependency("pixels", .{})) |pixels_dep| { + inline for (.{ "000000", "FFFFFF" }) |color| { + inline for (.{ "gif", "jpg", "png", "ppm" }) |extension| { + const filename = std.fmt.comptimePrint( + "1x1#{s}.{s}", + .{ color, extension }, + ); + unit_tests.root_module.addAnonymousImport(filename, .{ + .root_source_file = pixels_dep.path(filename), + }); + } + } + } + + const run_unit_tests = b.addRunArtifact(unit_tests); + + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&run_unit_tests.step); +} |
