The SDK has one root location, so why not just pass that, instead of passing three paths.
My usage code now looks like this:
var sdl_opts: struct {
target: @TypeOf(target),
optimize: @TypeOf(optimize),
system_include_path: ?std.Build.LazyPath = null,
system_framework_path: ?std.Build.LazyPath = null,
library_path: ?std.Build.LazyPath = null,
} = .{
.target = target,
.optimize = optimize,
};
if (target.result.os.tag.isDarwin()) {
if (b.sysroot) |sysroot| {
sdl_opts.system_include_path = std.Build.LazyPath{ .cwd_relative = b.pathJoin(&.{ sysroot, "/usr/include" }) };
sdl_opts.system_framework_path = std.Build.LazyPath{ .cwd_relative = b.pathJoin(&.{ sysroot, "/System/Library/Frameworks" }) };
sdl_opts.library_path = std.Build.LazyPath{ .cwd_relative = b.pathJoin(&.{ sysroot, "/usr/lib" }) };
} else @panic(" Pass --sysroot <path/to/macOS/SDK>");
}
const sdl_dep = b.dependency("sdl", sdl_opts);
I think the SDL build.zig file could construct the relative paths if needed.
The SDK has one root location, so why not just pass that, instead of passing three paths.
My usage code now looks like this:
I think the SDL build.zig file could construct the relative paths if needed.