diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-03-05 17:38:04 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-05 17:38:04 +0000 |
| commit | bb8a440c7a117762fd5c5d08b4aaf3d803a581aa (patch) | |
| tree | 34db41a60d44f53ac8ce2b729d09f744d6352f95 /build.zig | |
| parent | update for Zig 0.14.0 (diff) | |
| download | glsl-view-hap.tar.gz glsl-view-hap.zip | |
wip HAP codechap
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -5,6 +5,7 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const have_ffmpeg = b.option(bool, "textures", "enable texture/video support (needs ffmpeg)") orelse true; + const have_hap = have_ffmpeg and b.option(bool, "hap", "enable HAP GPU upload support (need snappy)") orelse true; const exe = b.addExecutable(.{ .name = "glsl-view", @@ -15,6 +16,7 @@ pub fn build(b: *std.Build) void { const options = b.addOptions(); options.addOption(bool, "have_ffmpeg", have_ffmpeg); + options.addOption(bool, "have_hap", have_hap); exe.root_module.addOptions("build_config", options); exe.linkLibC(); @@ -30,6 +32,12 @@ pub fn build(b: *std.Build) void { exe.linkSystemLibrary("libswscale"); } + if (have_ffmpeg and have_hap) { + exe.addIncludePath(b.path("lib")); + exe.addCSourceFile(.{ .file = b.path("lib/hap.c") }); + exe.linkSystemLibrary("snappy"); + } + b.installArtifact(exe); const run_cmd = b.addRunArtifact(exe); |
