all: update to use latest Zig master APIs (#521)

Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
This commit is contained in:
NewbLuck 2022-09-09 20:07:30 -06:00 committed by GitHub
parent 0e71daf504
commit 46c4ea4ebd
Failed to generate hash of commit
4 changed files with 5 additions and 5 deletions

View file

@ -236,7 +236,7 @@ pub const App = struct {
deps: ?[]const Pkg = null, deps: ?[]const Pkg = null,
res_dirs: ?[]const []const u8 = null, res_dirs: ?[]const []const u8 = null,
}) App { }) App {
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, options.target) catch unreachable).target; const target = (std.zig.system.NativeTargetInfo.detect(options.target) catch unreachable).target;
const platform = Platform.fromTarget(target); const platform = Platform.fromTarget(target);
var deps = std.ArrayList(std.build.Pkg).init(b.allocator); var deps = std.ArrayList(std.build.Pkg).init(b.allocator);

View file

@ -142,7 +142,7 @@ pub fn buildFreetype(b: *Builder, mode: std.builtin.Mode, target: std.zig.CrossT
if (options.brotli) if (options.brotli)
lib.defineCMacro("FT_REQUIRE_BROTLI", "1"); lib.defineCMacro("FT_REQUIRE_BROTLI", "1");
const target_info = (std.zig.system.NativeTargetInfo.detect(b.allocator, target) catch unreachable).target; const target_info = (std.zig.system.NativeTargetInfo.detect(target) catch unreachable).target;
if (target_info.os.tag == .windows) { if (target_info.os.tag == .windows) {
lib.addCSourceFile(ft_root ++ "/builds/windows/ftsystem.c", &.{}); lib.addCSourceFile(ft_root ++ "/builds/windows/ftsystem.c", &.{});

View file

@ -64,7 +64,7 @@ pub const Options = struct {
}; };
pub fn include(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { pub fn include(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void {
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target; const target = (std.zig.system.NativeTargetInfo.detect(step.target) catch unreachable).target;
switch (target.os.tag) { switch (target.os.tag) {
.windows => includeSdkWindowsX8664(b, step, options), .windows => includeSdkWindowsX8664(b, step, options),
.macos => includeSdkMacOS(b, step, options), .macos => includeSdkMacOS(b, step, options),
@ -76,7 +76,7 @@ pub fn include(b: *Builder, step: *std.build.LibExeObjStep, options: Options) vo
} }
fn includeSdkMacOS(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { fn includeSdkMacOS(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void {
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target; const target = (std.zig.system.NativeTargetInfo.detect(step.target) catch unreachable).target;
const mac_12 = target.os.version_range.semver.isAtLeast(.{ .major = 12, .minor = 0 }) orelse false; const mac_12 = target.os.version_range.semver.isAtLeast(.{ .major = 12, .minor = 0 }) orelse false;
const sdk_name = if (mac_12) options.macos_sdk_12 else options.macos_sdk_11; const sdk_name = if (mac_12) options.macos_sdk_12 else options.macos_sdk_11;
const sdk_revision = if (mac_12) options.macos_sdk_12_revision else options.macos_sdk_11_revision; const sdk_revision = if (mac_12) options.macos_sdk_12_revision else options.macos_sdk_11_revision;

View file

@ -102,7 +102,7 @@ fn buildSoundIo(b: *Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget
lib.addIncludePath(soundio_path); lib.addIncludePath(soundio_path);
lib.addCSourceFiles(soundio_sources, &.{}); lib.addCSourceFiles(soundio_sources, &.{});
const target_info = (std.zig.system.NativeTargetInfo.detect(b.allocator, target) catch unreachable).target; const target_info = (std.zig.system.NativeTargetInfo.detect(target) catch unreachable).target;
if (target_info.isDarwin()) { if (target_info.isDarwin()) {
lib.addCSourceFile(soundio_path ++ "/src/coreaudio.c", &.{}); lib.addCSourceFile(soundio_path ++ "/src/coreaudio.c", &.{});
lib.linkFramework("AudioToolbox"); lib.linkFramework("AudioToolbox");