authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-12-19 16:01:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-01 17:51:21-07:00
log3b36c4d0b30285ceb3576e621a4dc2b98a30d424
tree544c73f6f88584e373a6851cdf47bf0da67c0ea9
parent056f04c1ff71fe6e4cf18d7b46bc821b12d874f1

zig build: pass resolved_target to Module.create

it's now required to pass this for the root module

1 files changed, 10 insertions(+), 8 deletions(-)

src/main.zig+10-8
......@@ -5234,11 +5234,15 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
52345234 gimmeMoreOfThoseSweetSweetFileDescriptors();
52355235
52365236 const target_query: std.Target.Query = .{};
5237 const target = resolveTargetQueryOrFatal(target_query);
5237 const resolved_target: Package.Module.ResolvedTarget = .{
5238 .result = resolveTargetQueryOrFatal(target_query),
5239 .is_native_os = true,
5240 .is_native_abi = true,
5241 };
52385242
52395243 const exe_basename = try std.zig.binNameAlloc(arena, .{
52405244 .root_name = "build",
5241 .target = target,
5245 .target = resolved_target.result,
52425246 .output_mode = .Exe,
52435247 });
52445248 const emit_bin: Compilation.EmitLoc = .{
......@@ -5262,11 +5266,7 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
52625266
52635267 const config = try Compilation.Config.resolve(.{
52645268 .output_mode = .Exe,
5265 .resolved_target = .{
5266 .result = target,
5267 .is_native_os = true,
5268 .is_native_abi = true,
5269 },
5269 .resolved_target = resolved_target,
52705270 .have_zcu = true,
52715271 .emit_bin = true,
52725272 .is_test = false,
......@@ -5277,7 +5277,9 @@ pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !voi
52775277 .paths = main_mod_paths,
52785278 .fully_qualified_name = "root",
52795279 .cc_argv = &.{},
5280 .inherited = .{},
5280 .inherited = .{
5281 .resolved_target = resolved_target,
5282 },
52815283 .global = config,
52825284 .parent = null,
52835285 .builtin_mod = null,