diff --git a/build.zig b/build.zig index 88a608e52..6f1e43ce2 100644 --- a/build.zig +++ b/build.zig @@ -134,7 +134,7 @@ pub fn build(b: *std.Build) !void { else linux.build(b, target.result, lib, build_config_h), .windows => windows.build(b, target.result, lib, build_config_h), - .macos => macos.build(b, target.result, lib, build_config_h), + .macos => macos.build(b, target.result, lib, build_config_h, system_paths), .ios => ios.build(b, target.result, lib, build_config_h, system_paths), else => @panic("target has no default config"), } diff --git a/src/macos.zig b/src/macos.zig index fc082978c..b414fb57d 100644 --- a/src/macos.zig +++ b/src/macos.zig @@ -5,16 +5,15 @@ const root = @import("../build.zig"); const Subsystems = root.Subsystems; const AllDrivers = root.Drivers; -pub fn build( - b: *std.Build, - target: std.Target, - lib: *std.Build.Step.Compile, - build_config_h: *std.Build.Step.ConfigHeader, -) void { +pub fn build(b: *std.Build, target: std.Target, lib: *std.Build.Step.Compile, build_config_h: *std.Build.Step.ConfigHeader, paths: root.SystemPaths) void { _ = target; const upstream = b.dependency("sdl", .{}); + if (paths.include) |p| lib.root_module.addSystemIncludePath(p); + if (paths.framework) |p| lib.root_module.addSystemFrameworkPath(p); + if (paths.library) |p| lib.root_module.addLibraryPath(p); + // Link with the platform specific system frameworks lib.root_module.linkFramework("Cocoa", .{}); lib.root_module.linkFramework("IOKit", .{});