| ... | ... | @@ -9,13 +9,12 @@ const print = std.debug.print; |
| 9 | 9 | const mem = std.mem; |
| 10 | 10 | const testing = std.testing; |
| 11 | 11 | const Allocator = std.mem.Allocator; |
| 12 | const getExternalExecutor = std.zig.system.getExternalExecutor; |
| 12 | 13 | |
| 13 | 14 | const max_doc_file_size = 10 * 1024 * 1024; |
| 14 | 15 | |
| 15 | | const exe_ext = @as(std.zig.CrossTarget, .{}).exeFileExt(); |
| 16 | 16 | const obj_ext = builtin.object_format.fileExt(builtin.cpu.arch); |
| 17 | 17 | const tmp_dir_name = "docgen_tmp"; |
| 18 | | const test_out_path = tmp_dir_name ++ fs.path.sep_str ++ "test" ++ exe_ext; |
| 19 | 18 | |
| 20 | 19 | const usage = |
| 21 | 20 | \\Usage: docgen [--zig] [--skip-code-tests] input output" |
| ... | ... | @@ -1309,7 +1308,7 @@ fn genHtml( |
| 1309 | 1308 | var env_map = try process.getEnvMap(allocator); |
| 1310 | 1309 | try env_map.put("YES_COLOR", "1"); |
| 1311 | 1310 | |
| 1312 | | const host = try std.zig.system.NativeTargetInfo.detect(.{}); |
| 1311 | const host = try std.zig.system.resolveTargetQuery(.{}); |
| 1313 | 1312 | const builtin_code = try getBuiltinCode(allocator, &env_map, zig_exe, opt_zig_lib_dir); |
| 1314 | 1313 | |
| 1315 | 1314 | for (toc.nodes) |node| { |
| ... | ... | @@ -1424,9 +1423,7 @@ fn genHtml( |
| 1424 | 1423 | try build_args.append("-lc"); |
| 1425 | 1424 | try shell_out.print("-lc ", .{}); |
| 1426 | 1425 | } |
| 1427 | | const target = try std.zig.CrossTarget.parse(.{ |
| 1428 | | .arch_os_abi = code.target_str orelse "native", |
| 1429 | | }); |
| 1426 | |
| 1430 | 1427 | if (code.target_str) |triple| { |
| 1431 | 1428 | try build_args.appendSlice(&[_][]const u8{ "-target", triple }); |
| 1432 | 1429 | try shell_out.print("-target {s} ", .{triple}); |
| ... | ... | @@ -1490,9 +1487,13 @@ fn genHtml( |
| 1490 | 1487 | } |
| 1491 | 1488 | } |
| 1492 | 1489 | |
| 1490 | const target_query = try std.Target.Query.parse(.{ |
| 1491 | .arch_os_abi = code.target_str orelse "native", |
| 1492 | }); |
| 1493 | const target = try std.zig.system.resolveTargetQuery(target_query); |
| 1494 | |
| 1493 | 1495 | const path_to_exe = try std.fmt.allocPrint(allocator, "./{s}{s}", .{ |
| 1494 | | code.name, |
| 1495 | | target.exeFileExt(), |
| 1496 | code.name, target.exeFileExt(), |
| 1496 | 1497 | }); |
| 1497 | 1498 | const run_args = &[_][]const u8{path_to_exe}; |
| 1498 | 1499 | |
| ... | ... | @@ -1565,13 +1566,13 @@ fn genHtml( |
| 1565 | 1566 | try test_args.appendSlice(&[_][]const u8{ "-target", triple }); |
| 1566 | 1567 | try shell_out.print("-target {s} ", .{triple}); |
| 1567 | 1568 | |
| 1568 | | const cross_target = try std.zig.CrossTarget.parse(.{ |
| 1569 | const target_query = try std.Target.Query.parse(.{ |
| 1569 | 1570 | .arch_os_abi = triple, |
| 1570 | 1571 | }); |
| 1571 | | const target_info = try std.zig.system.NativeTargetInfo.detect( |
| 1572 | | cross_target, |
| 1572 | const target = try std.zig.system.resolveTargetQuery( |
| 1573 | target_query, |
| 1573 | 1574 | ); |
| 1574 | | switch (host.getExternalExecutor(&target_info, .{ |
| 1575 | switch (getExternalExecutor(host, &target, .{ |
| 1575 | 1576 | .link_libc = code.link_libc, |
| 1576 | 1577 | })) { |
| 1577 | 1578 | .native => {}, |