diff options
Diffstat (limited to 'src/Config.zig')
| -rw-r--r-- | src/Config.zig | 13 |
1 files changed, 4 insertions, 9 deletions
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; | |||
| 6 | const ArenaAllocator = std.heap.ArenaAllocator; | 6 | const ArenaAllocator = std.heap.ArenaAllocator; |
| 7 | const ArrayList = std.ArrayList; | 7 | const ArrayList = std.ArrayList; |
| 8 | const Config = @This(); | 8 | const Config = @This(); |
| 9 | const CrossTarget = std.zig.CrossTarget; | ||
| 10 | const File = std.fs.File; | 9 | const File = std.fs.File; |
| 11 | const NativeTargetInfo = std.zig.system.NativeTargetInfo; | ||
| 12 | const Target = std.Target; | 10 | const Target = std.Target; |
| 13 | 11 | ||
| 14 | allocator: Allocator, | 12 | allocator: Allocator, |
| @@ -81,7 +79,7 @@ fn readConfig(self: *Config, file: File) !void { | |||
| 81 | try self.supported_targets.ensureUnusedCapacity(parsed.supported_targets.len); | 79 | try self.supported_targets.ensureUnusedCapacity(parsed.supported_targets.len); |
| 82 | 80 | ||
| 83 | for (parsed.supported_targets) |target| { | 81 | for (parsed.supported_targets) |target| { |
| 84 | const ct = CrossTarget.parse(.{ | 82 | const query = Target.Query.parse(.{ |
| 85 | .arch_os_abi = target, | 83 | .arch_os_abi = target, |
| 86 | }) catch |e| { | 84 | }) catch |e| { |
| 87 | std.log.warn( | 85 | std.log.warn( |
| @@ -91,14 +89,11 @@ fn readConfig(self: *Config, file: File) !void { | |||
| 91 | continue; | 89 | continue; |
| 92 | }; | 90 | }; |
| 93 | 91 | ||
| 94 | const nti = NativeTargetInfo.detect(ct) catch |e| { | 92 | const resolved = std.zig.system.resolveTargetQuery(query) catch |e| { |
| 95 | std.log.warn( | 93 | std.log.warn("Failed to resolve '{s}' as a target: {}", .{ target, e}); |
| 96 | "Failed to detect NativeTargetInfo from '{s}': {}", | ||
| 97 | .{ target, e }, | ||
| 98 | ); | ||
| 99 | continue; | 94 | continue; |
| 100 | }; | 95 | }; |
| 101 | 96 | ||
| 102 | self.supported_targets.appendAssumeCapacity(nti.target); | 97 | self.supported_targets.appendAssumeCapacity(resolved); |
| 103 | } | 98 | } |
| 104 | } | 99 | } |