summary refs log tree commit diff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig17
1 files changed, 11 insertions, 6 deletions
diff --git a/build.zig b/build.zig
index afc422f..9dd9fa2 100644
--- a/build.zig
+++ b/build.zig
@@ -24,13 +24,14 @@ pub fn build(b: *std.build.Builder) void {
     const mode = b.standardReleaseOptions();
 
     const lib = b.addStaticLibrary("zeal", "src/zeal.zig");
+    lib.linkSystemLibrary("openal");
+    lib.linkSystemLibrary("sndfile");
+    lib.linkSystemLibrary("c");
     lib.setBuildMode(mode);
     lib.install();
 
     var main_tests = b.addTest("src/zeal.zig");
-    main_tests.linkSystemLibrary("openal");
-    main_tests.linkSystemLibrary("sndfile");
-    main_tests.linkSystemLibrary("c");
+    main_tests.linkLibrary(lib);
     main_tests.setBuildMode(mode);
 
     const test_step = b.step("test", "Run library tests");
@@ -38,9 +39,13 @@ pub fn build(b: *std.build.Builder) void {
 
     const example_play = b.addExecutable("zeal-play", "examples/play.zig");
     example_play.addPackagePath("zeal", "src/zeal.zig");
-    example_play.linkSystemLibrary("openal");
-    example_play.linkSystemLibrary("sndfile");
-    example_play.linkSystemLibrary("c");
+    example_play.linkLibrary(lib);
     example_play.setBuildMode(mode);
     example_play.install();
+
+    const example_hrtf = b.addExecutable("zeal-hrtf", "examples/hrtf.zig");
+    example_hrtf.addPackagePath("zeal", "src/zeal.zig");
+    example_hrtf.linkLibrary(lib);
+    example_hrtf.setBuildMode(mode);
+    example_hrtf.install();
 }