std.Build: Make ofmt part of standardTargetOptions().
This commit is contained in:
11
build.zig
11
build.zig
@@ -16,12 +16,11 @@ const stack_size = 46 * 1024 * 1024;
|
||||
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const only_c = b.option(bool, "only-c", "Translate the Zig compiler to C code, with only the C backend enabled") orelse false;
|
||||
const target = t: {
|
||||
var default_target: std.Target.Query = .{};
|
||||
default_target.ofmt = b.option(std.Target.ObjectFormat, "ofmt", "Object format to target") orelse if (only_c) .c else null;
|
||||
break :t b.standardTargetOptions(.{ .default_target = default_target });
|
||||
};
|
||||
|
||||
const target = b.standardTargetOptions(.{
|
||||
.default_target = .{
|
||||
.ofmt = if (only_c) .c else null,
|
||||
},
|
||||
});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const flat = b.option(bool, "flat", "Put files into the installation prefix in a manner suited for upstream distribution rather than a posix file system hierarchy standard") orelse false;
|
||||
|
||||
Reference in New Issue
Block a user