From f0161ce3c4e86ea1c309b1db67ca77066bb02779 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Fri, 2 Feb 2024 17:59:21 +0200 Subject: Update for latest zig --- src/Config.zig | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/Config.zig') diff --git a/src/Config.zig b/src/Config.zig index e559cad..ba8f496 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -6,9 +6,7 @@ const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const ArrayList = std.ArrayList; const Config = @This(); -const CrossTarget = std.zig.CrossTarget; const File = std.fs.File; -const NativeTargetInfo = std.zig.system.NativeTargetInfo; const Target = std.Target; allocator: Allocator, @@ -81,7 +79,7 @@ fn readConfig(self: *Config, file: File) !void { try self.supported_targets.ensureUnusedCapacity(parsed.supported_targets.len); for (parsed.supported_targets) |target| { - const ct = CrossTarget.parse(.{ + const query = Target.Query.parse(.{ .arch_os_abi = target, }) catch |e| { std.log.warn( @@ -91,14 +89,11 @@ fn readConfig(self: *Config, file: File) !void { continue; }; - const nti = NativeTargetInfo.detect(ct) catch |e| { - std.log.warn( - "Failed to detect NativeTargetInfo from '{s}': {}", - .{ target, e }, - ); + const resolved = std.zig.system.resolveTargetQuery(query) catch |e| { + std.log.warn("Failed to resolve '{s}' as a target: {}", .{ target, e}); continue; }; - self.supported_targets.appendAssumeCapacity(nti.target); + self.supported_targets.appendAssumeCapacity(resolved); } } -- cgit v1.2.3