Skip to content

Commit 826f5e3

Browse files
committed
std.Build.resolveTargetQuery: fix ignoring ofmt for native
1 parent b360b6a commit 826f5e3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/std/Build.zig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,14 @@ pub const ResolvedTarget = struct {
23112311
/// Converts a target query into a fully resolved target that can be passed to
23122312
/// various parts of the API.
23132313
pub fn resolveTargetQuery(b: *Build, query: Target.Query) ResolvedTarget {
2314-
if (query.isNative()) return b.host;
2314+
if (query.isNative()) {
2315+
var adjusted = b.host;
2316+
if (query.ofmt) |ofmt| {
2317+
adjusted.query.ofmt = ofmt;
2318+
adjusted.result.ofmt = ofmt;
2319+
}
2320+
return adjusted;
2321+
}
23152322

23162323
return .{
23172324
.query = query,

0 commit comments

Comments
 (0)