diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-09-13 21:01:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-09-13 21:01:06 +0200 |
commit | a1b12e879c16dcdfbcc5fc8975ba14d692528c6b (patch) | |
tree | b8d3d6a7cc6ac1598b21a9570db29df006de8e8d | |
parent | 2ca2386c1f41f3820e22281de570b19380682086 (diff) |
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | build.zig | 32 |
2 files changed, 35 insertions, 0 deletions
@@ -21,3 +21,6 @@ /utils/tinypcminfo /bazel* + +zig-out/ +zig-cache/
\ No newline at end of file diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..0870992 --- /dev/null +++ b/build.zig @@ -0,0 +1,32 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const lib = b.addStaticLibrary(.{ + .name = "tinyalsa", + .target = target, + .optimize = optimize, + }); + + lib.addCSourceFiles(&.{ + "src/limits.c", + "src/mixer_hw.c", + "src/mixer_plugin.c", + "src/mixer.c", + "src/pcm_plugin.c", + "src/snd_card_plugin.c", + "src/pcm_hw.c", + "src/pcm.c", + }, &.{}); + + lib.addIncludePath(.{ .path = "include" }); + lib.linkLibC(); + lib.installHeadersDirectory("include", "."); + lib.strip = optimize != std.builtin.OptimizeMode.Debug; + lib.want_lto = optimize != std.builtin.OptimizeMode.Debug; + lib.single_threaded = true; + + b.installArtifact(lib); +} |