mach: expose sysaudio/sysjs packages
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
09ec61b5cd
commit
2e61125601
2 changed files with 9 additions and 4 deletions
11
build.zig
11
build.zig
|
|
@ -97,10 +97,8 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
inline for (example.packages) |p| {
|
inline for (example.packages) |p| {
|
||||||
if (std.mem.eql(u8, p.name, freetype.pkg.name))
|
if (std.mem.eql(u8, p.name, freetype.pkg.name))
|
||||||
freetype.link(example_app.b, example_app.step, .{});
|
freetype.link(example_app.b, example_app.step, .{});
|
||||||
|
|
||||||
if (std.mem.eql(u8, p.name, sysaudio.pkg.name))
|
|
||||||
sysaudio.link(example_app.b, example_app.step, .{});
|
|
||||||
}
|
}
|
||||||
|
sysaudio.link(example_app.b, example_app.step, .{});
|
||||||
|
|
||||||
example_app.link(options);
|
example_app.link(options);
|
||||||
example_app.install();
|
example_app.install();
|
||||||
|
|
@ -151,6 +149,7 @@ pub fn build(b: *std.build.Builder) void {
|
||||||
lib.addPackage(app_pkg);
|
lib.addPackage(app_pkg);
|
||||||
lib.addPackage(gpu.pkg);
|
lib.addPackage(gpu.pkg);
|
||||||
lib.addPackage(glfw.pkg);
|
lib.addPackage(glfw.pkg);
|
||||||
|
lib.addPackage(sysaudio.pkg);
|
||||||
glfw.link(b, lib, options.glfw_options);
|
glfw.link(b, lib, options.glfw_options);
|
||||||
gpu.link(b, lib, options.gpuOptions());
|
gpu.link(b, lib, options.gpuOptions());
|
||||||
lib.setOutputDir("./libmach/build");
|
lib.setOutputDir("./libmach/build");
|
||||||
|
|
@ -220,6 +219,7 @@ pub const App = struct {
|
||||||
var deps = std.ArrayList(std.build.Pkg).init(b.allocator);
|
var deps = std.ArrayList(std.build.Pkg).init(b.allocator);
|
||||||
deps.append(pkg) catch unreachable;
|
deps.append(pkg) catch unreachable;
|
||||||
deps.append(gpu.pkg) catch unreachable;
|
deps.append(gpu.pkg) catch unreachable;
|
||||||
|
deps.append(sysaudio.pkg) catch unreachable;
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
.native => deps.append(glfw.pkg) catch unreachable,
|
.native => deps.append(glfw.pkg) catch unreachable,
|
||||||
.web => deps.append(sysjs.pkg) catch unreachable,
|
.web => deps.append(sysjs.pkg) catch unreachable,
|
||||||
|
|
@ -236,15 +236,18 @@ pub const App = struct {
|
||||||
if (platform == .web) {
|
if (platform == .web) {
|
||||||
const lib = b.addSharedLibrary(options.name, (comptime thisDir()) ++ "/src/platform/wasm.zig", .unversioned);
|
const lib = b.addSharedLibrary(options.name, (comptime thisDir()) ++ "/src/platform/wasm.zig", .unversioned);
|
||||||
lib.addPackage(gpu.pkg);
|
lib.addPackage(gpu.pkg);
|
||||||
|
lib.addPackage(sysaudio.pkg);
|
||||||
lib.addPackage(sysjs.pkg);
|
lib.addPackage(sysjs.pkg);
|
||||||
|
|
||||||
break :blk lib;
|
break :blk lib;
|
||||||
} else {
|
} else {
|
||||||
const exe = b.addExecutable(options.name, (comptime thisDir()) ++ "/src/platform/native.zig");
|
const exe = b.addExecutable(options.name, (comptime thisDir()) ++ "/src/platform/native.zig");
|
||||||
exe.addPackage(gpu.pkg);
|
exe.addPackage(gpu.pkg);
|
||||||
|
exe.addPackage(sysaudio.pkg);
|
||||||
exe.addPackage(glfw.pkg);
|
exe.addPackage(glfw.pkg);
|
||||||
|
|
||||||
if (target.os.tag == .linux) {
|
if (target.os.tag == .linux) {
|
||||||
|
// TODO: add gamemode.pkg instead of using addPackagePath
|
||||||
exe.addPackagePath("gamemode", (comptime thisDir()) ++ "/libs/gamemode/gamemode.zig");
|
exe.addPackagePath("gamemode", (comptime thisDir()) ++ "/libs/gamemode/gamemode.zig");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -374,7 +377,7 @@ pub const App = struct {
|
||||||
pub const pkg = std.build.Pkg{
|
pub const pkg = std.build.Pkg{
|
||||||
.name = "mach",
|
.name = "mach",
|
||||||
.source = .{ .path = thisDir() ++ "/src/main.zig" },
|
.source = .{ .path = thisDir() ++ "/src/main.zig" },
|
||||||
.dependencies = &.{ gpu.pkg, ecs.pkg },
|
.dependencies = &.{ gpu.pkg, ecs.pkg, sysaudio.pkg },
|
||||||
};
|
};
|
||||||
|
|
||||||
fn thisDir() []const u8 {
|
fn thisDir() []const u8 {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ pub const Timer = @import("Timer.zig");
|
||||||
pub const ResourceManager = @import("resource/ResourceManager.zig");
|
pub const ResourceManager = @import("resource/ResourceManager.zig");
|
||||||
pub const gpu = @import("gpu");
|
pub const gpu = @import("gpu");
|
||||||
pub const ecs = @import("ecs");
|
pub const ecs = @import("ecs");
|
||||||
|
pub const sysaudio = @import("sysaudio");
|
||||||
|
pub const sysjs = @import("sysjs");
|
||||||
|
|
||||||
// Engine exports
|
// Engine exports
|
||||||
pub const App = @import("engine.zig").App;
|
pub const App = @import("engine.zig").App;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue