···2121 // target and optimize options) will be listed when running `zig build --help`
2222 // in this directory.
23232424+ const translate_c = b.addTranslateC(.{
2525+ .root_source_file = b.path("src/alsa.h"),
2626+ .optimize = optimize,
2727+ .target = target,
2828+ });
2929+ translate_c.linkSystemLibrary("asound", .{ .needed = true }); // change to false when going crossplatform
3030+3131+ const alsa_mod = translate_c.createModule();
3232+2433 // This creates a module, which represents a collection of source files alongside
2534 // some compilation options, such as optimization mode and linked system libraries.
2635 // Zig modules are the preferred way of making Zig code available to consumers.
···4049 // which requires us to specify a target.
4150 .target = target,
4251 });
5252+ mod.addImport("alsa-ffi", alsa_mod);
43534454 // Here we define an executable. An executable needs to have a root module
4555 // which needs to expose a `main` function. While we could add a main function
···7989 // can be extremely useful in case of collisions (which can happen
8090 // importing modules from different packages).
8191 .{ .name = "midi-synth", .module = mod },
9292+ .{ .name = "alsa-ffi", .module = alsa_mod },
8293 },
8394 }),
8495 });