Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Dev PR 1 #336

Merged
merged 7 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pub fn build(b: *std.Build) !void {
exe.linkLibC();
exe.linkLibCpp();

const deps = b.dependency("deps", .{
// For the time being, MacOS cubyz_deps will not have released binaries.
const depsName = if (t.os.tag == .macos) "deps_local" else "deps";
const deps = b.dependency(depsName, .{
.target = target,
.optimize = optimize,
});
Expand All @@ -42,6 +44,19 @@ pub fn build(b: *std.Build) !void {
exe.linkSystemLibrary("asound");
exe.linkSystemLibrary("x11");
exe.linkSystemLibrary("GL");
} else if(t.os.tag == .macos) {
exe.linkFramework("AudioUnit");
exe.linkFramework("AudioToolbox");
exe.linkFramework("CoreAudio");
exe.linkFramework("CoreServices");
exe.linkFramework("Foundation");
exe.linkFramework("IOKit");
exe.linkFramework("Cocoa");
exe.linkFramework("QuartzCore");
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("X11");
exe.addLibraryPath(.{.path="/usr/local/GL/lib"});
exe.addLibraryPath(.{.path="/opt/X11/lib"});
} else {
std.log.err("Unsupported target: {}\n", .{t.os.tag});
}
Expand Down
8 changes: 6 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
.version = "0.0.0",
.paths = .{""},
.dependencies = .{
.deps_local = .{
.url = "file:../Cubyz-libs/zig-out.tar.gz", // macos has no official deps release
IntegratedQuantum marked this conversation as resolved.
Show resolved Hide resolved
.hash = "12209f7db8911ff57c69db2097437ad5e00141e862b0e760926c966b8652d09edf43",
},
.deps = .{
//.url = "file:///home/mint/Cubyz-libs/zig-out.tar.gz", // fetching the lib from the local folder
// url = "file:../Cubyz-libs/zig-out.tar.gz", // fetching the lib from the local folder
IntegratedQuantum marked this conversation as resolved.
Show resolved Hide resolved
.url = "https://github.com/PixelGuys/Cubyz-libs/releases/download/2/zig-out.tar.gz",
.hash = "12201446153e8822c020a10199880fae5fac7eb3f1e3f7c7a9b653e58914fa3e2223",
},
},
}
}
Loading