summaryrefslogtreecommitdiff
path: root/src/Config.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Config.zig')
-rw-r--r--src/Config.zig13
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;
6const ArenaAllocator = std.heap.ArenaAllocator; 6const ArenaAllocator = std.heap.ArenaAllocator;
7const ArrayList = std.ArrayList; 7const ArrayList = std.ArrayList;
8const Config = @This(); 8const Config = @This();
9const CrossTarget = std.zig.CrossTarget;
10const File = std.fs.File; 9const File = std.fs.File;
11const NativeTargetInfo = std.zig.system.NativeTargetInfo;
12const Target = std.Target; 10const Target = std.Target;
13 11
14allocator: Allocator, 12allocator: 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}