| ... | @@ -17,7 +17,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -17,7 +17,7 @@ pub fn build(b: *Builder) !void { |
| 17 | b.setPreferredReleaseMode(.ReleaseFast); | 17 | b.setPreferredReleaseMode(.ReleaseFast); |
| 18 | const test_step = b.step("test", "Run all the tests"); | 18 | const test_step = b.step("test", "Run all the tests"); |
| 19 | const mode = b.standardReleaseOptions(); | 19 | const mode = b.standardReleaseOptions(); |
| 20 | const target = b.standardTargetOptions(.{}); | 20 | var target = b.standardTargetOptions(.{}); |
| 21 | const single_threaded = b.option(bool, "single-threaded", "Build artifacts that run in single threaded mode"); | 21 | const single_threaded = b.option(bool, "single-threaded", "Build artifacts that run in single threaded mode"); |
| 22 | const use_zig_libcxx = b.option(bool, "use-zig-libcxx", "If libc++ is needed, use zig's bundled version, don't try to integrate with the system") orelse false; | 22 | const use_zig_libcxx = b.option(bool, "use-zig-libcxx", "If libc++ is needed, use zig's bundled version, don't try to integrate with the system") orelse false; |
| 23 | | 23 | |
| ... | @@ -141,6 +141,10 @@ pub fn build(b: *Builder) !void { | ... | @@ -141,6 +141,10 @@ pub fn build(b: *Builder) !void { |
| 141 | break :blk 4; | 141 | break :blk 4; |
| 142 | }; | 142 | }; |
| 143 | | 143 | |
| | 144 | if (only_c) { |
| | 145 | target.ofmt = .c; |
| | 146 | } |
| | 147 | |
| 144 | const main_file: ?[]const u8 = mf: { | 148 | const main_file: ?[]const u8 = mf: { |
| 145 | if (!have_stage1) break :mf "src/main.zig"; | 149 | if (!have_stage1) break :mf "src/main.zig"; |
| 146 | if (use_zig0) break :mf null; | 150 | if (use_zig0) break :mf null; |
| ... | @@ -172,10 +176,6 @@ pub fn build(b: *Builder) !void { | ... | @@ -172,10 +176,6 @@ pub fn build(b: *Builder) !void { |
| 172 | test_cases.want_lto = false; | 176 | test_cases.want_lto = false; |
| 173 | } | 177 | } |
| 174 | | 178 | |
| 175 | if (only_c) { | | |
| 176 | exe.ofmt = .c; | | |
| 177 | } | | |
| 178 | | | |
| 179 | const exe_options = b.addOptions(); | 179 | const exe_options = b.addOptions(); |
| 180 | exe.addOptions("build_options", exe_options); | 180 | exe.addOptions("build_options", exe_options); |
| 181 | | 181 | |