mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Mac Dev PR 1 (#336)
* Add libraries for macos + deps_local * Tab characters * build.zig.zon: MacOS comment, use relative path * build.zig.zon: Add dot to url field * build.zig: lazily load deps_local * build.zig: revert bad debug edit
This commit is contained in:
parent
50d9c9a825
commit
1a6454a92c
24
build.zig
24
build.zig
@ -21,10 +21,17 @@ 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.lazyDependency(depsName, .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
}) orelse {
|
||||
// Lazy dependencies with a `url` field will fail here the first time.
|
||||
// build.zig will restart and try again.
|
||||
std.log.info("Downloading dependency {s}.", .{depsName});
|
||||
return;
|
||||
};
|
||||
|
||||
exe.addLibraryPath(deps.path("lib"));
|
||||
exe.addIncludePath(deps.path("include"));
|
||||
@ -42,6 +49,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});
|
||||
}
|
||||
|
@ -3,8 +3,12 @@
|
||||
.version = "0.0.0",
|
||||
.paths = .{""},
|
||||
.dependencies = .{
|
||||
.deps_local = .{
|
||||
.path = "../Cubyz-libs/zig-out", // macos has no official deps release
|
||||
.lazy = true,
|
||||
},
|
||||
.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
|
||||
.url = "https://github.com/PixelGuys/Cubyz-libs/releases/download/2/zig-out.tar.gz",
|
||||
.hash = "12201446153e8822c020a10199880fae5fac7eb3f1e3f7c7a9b653e58914fa3e2223",
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user