diff options
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); |
