| ... | @@ -17,8 +17,10 @@ pub fn build(b: *Builder) !void { | ... | @@ -17,8 +17,10 @@ pub fn build(b: *Builder) !void { |
| 17 | b.setPreferredReleaseMode(.ReleaseFast); | 17 | b.setPreferredReleaseMode(.ReleaseFast); |
| 18 | const mode = b.standardReleaseOptions(); | 18 | const mode = b.standardReleaseOptions(); |
| 19 | const target = b.standardTargetOptions(.{}); | 19 | const target = b.standardTargetOptions(.{}); |
| | 20 | const single_threaded = b.option(bool, "single-threaded", "Build artifacts that run in single threaded mode") orelse false; |
| 20 | | 21 | |
| 21 | var docgen_exe = b.addExecutable("docgen", "doc/docgen.zig"); | 22 | var docgen_exe = b.addExecutable("docgen", "doc/docgen.zig"); |
| | 23 | docgen_exe.single_threaded = single_threaded; |
| 22 | | 24 | |
| 23 | const rel_zig_exe = try fs.path.relative(b.allocator, b.build_root, b.zig_exe); | 25 | const rel_zig_exe = try fs.path.relative(b.allocator, b.build_root, b.zig_exe); |
| 24 | const langref_out_path = fs.path.join( | 26 | const langref_out_path = fs.path.join( |
| ... | @@ -41,6 +43,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -41,6 +43,7 @@ pub fn build(b: *Builder) !void { |
| 41 | var test_stage2 = b.addTest("src/test.zig"); | 43 | var test_stage2 = b.addTest("src/test.zig"); |
| 42 | test_stage2.setBuildMode(mode); | 44 | test_stage2.setBuildMode(mode); |
| 43 | test_stage2.addPackagePath("test_cases", "test/cases.zig"); | 45 | test_stage2.addPackagePath("test_cases", "test/cases.zig"); |
| | 46 | test_stage2.single_threaded = single_threaded; |
| 44 | | 47 | |
| 45 | const fmt_build_zig = b.addFmt(&[_][]const u8{"build.zig"}); | 48 | const fmt_build_zig = b.addFmt(&[_][]const u8{"build.zig"}); |
| 46 | | 49 | |
| ... | @@ -104,6 +107,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -104,6 +107,7 @@ pub fn build(b: *Builder) !void { |
| 104 | exe.setTarget(target); | 107 | exe.setTarget(target); |
| 105 | toolchain_step.dependOn(&exe.step); | 108 | toolchain_step.dependOn(&exe.step); |
| 106 | b.default_step.dependOn(&exe.step); | 109 | b.default_step.dependOn(&exe.step); |
| | 110 | exe.single_threaded = single_threaded; |
| 107 | | 111 | |
| 108 | exe.addBuildOption(u32, "mem_leak_frames", mem_leak_frames); | 112 | exe.addBuildOption(u32, "mem_leak_frames", mem_leak_frames); |
| 109 | exe.addBuildOption(bool, "skip_non_native", skip_non_native); | 113 | exe.addBuildOption(bool, "skip_non_native", skip_non_native); |
| ... | @@ -131,6 +135,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -131,6 +135,7 @@ pub fn build(b: *Builder) !void { |
| 131 | softfloat.addIncludeDir("deps/SoftFloat-3e/source/8086"); | 135 | softfloat.addIncludeDir("deps/SoftFloat-3e/source/8086"); |
| 132 | softfloat.addIncludeDir("deps/SoftFloat-3e/source/include"); | 136 | softfloat.addIncludeDir("deps/SoftFloat-3e/source/include"); |
| 133 | softfloat.addCSourceFiles(&softfloat_sources, &[_][]const u8{ "-std=c99", "-O3" }); | 137 | softfloat.addCSourceFiles(&softfloat_sources, &[_][]const u8{ "-std=c99", "-O3" }); |
| | 138 | softfloat.single_threaded = single_threaded; |
| 134 | | 139 | |
| 135 | exe.linkLibrary(softfloat); | 140 | exe.linkLibrary(softfloat); |
| 136 | test_stage2.linkLibrary(softfloat); | 141 | test_stage2.linkLibrary(softfloat); |
| ... | @@ -296,7 +301,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -296,7 +301,7 @@ pub fn build(b: *Builder) !void { |
| 296 | "behavior", | 301 | "behavior", |
| 297 | "Run the behavior tests", | 302 | "Run the behavior tests", |
| 298 | modes, | 303 | modes, |
| 299 | false, | 304 | false, // skip_single_threaded |
| 300 | skip_non_native, | 305 | skip_non_native, |
| 301 | skip_libc, | 306 | skip_libc, |
| 302 | is_wine_enabled, | 307 | is_wine_enabled, |
| ... | @@ -313,9 +318,9 @@ pub fn build(b: *Builder) !void { | ... | @@ -313,9 +318,9 @@ pub fn build(b: *Builder) !void { |
| 313 | "compiler-rt", | 318 | "compiler-rt", |
| 314 | "Run the compiler_rt tests", | 319 | "Run the compiler_rt tests", |
| 315 | modes, | 320 | modes, |
| 316 | true, | 321 | true, // skip_single_threaded |
| 317 | skip_non_native, | 322 | skip_non_native, |
| 318 | true, | 323 | true, // skip_libc |
| 319 | is_wine_enabled, | 324 | is_wine_enabled, |
| 320 | is_qemu_enabled, | 325 | is_qemu_enabled, |
| 321 | is_wasmtime_enabled, | 326 | is_wasmtime_enabled, |
| ... | @@ -330,9 +335,9 @@ pub fn build(b: *Builder) !void { | ... | @@ -330,9 +335,9 @@ pub fn build(b: *Builder) !void { |
| 330 | "minilibc", | 335 | "minilibc", |
| 331 | "Run the mini libc tests", | 336 | "Run the mini libc tests", |
| 332 | modes, | 337 | modes, |
| 333 | true, | 338 | true, // skip_single_threaded |
| 334 | skip_non_native, | 339 | skip_non_native, |
| 335 | true, | 340 | true, // skip_libc |
| 336 | is_wine_enabled, | 341 | is_wine_enabled, |
| 337 | is_qemu_enabled, | 342 | is_qemu_enabled, |
| 338 | is_wasmtime_enabled, | 343 | is_wasmtime_enabled, |