| ... | @@ -33,6 +33,7 @@ pub fn build(b: *std.Build) !void { | ... | @@ -33,6 +33,7 @@ pub fn build(b: *std.Build) !void { |
| 33 | const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files; | 33 | const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files; |
| 34 | const skip_install_autodocs = b.option(bool, "no-autodocs", "skip copying of standard library autodocs to the installation prefix") orelse skip_install_lib_files; | 34 | const skip_install_autodocs = b.option(bool, "no-autodocs", "skip copying of standard library autodocs to the installation prefix") orelse skip_install_lib_files; |
| 35 | const no_bin = b.option(bool, "no-bin", "skip emitting compiler binary") orelse false; | 35 | const no_bin = b.option(bool, "no-bin", "skip emitting compiler binary") orelse false; |
| | 36 | const only_reduce = b.option(bool, "only-reduce", "only build zig reduce") orelse false; |
| 36 | | 37 | |
| 37 | const docgen_exe = b.addExecutable(.{ | 38 | const docgen_exe = b.addExecutable(.{ |
| 38 | .name = "docgen", | 39 | .name = "docgen", |
| ... | @@ -193,6 +194,10 @@ pub fn build(b: *std.Build) !void { | ... | @@ -193,6 +194,10 @@ pub fn build(b: *std.Build) !void { |
| 193 | }; | 194 | }; |
| 194 | | 195 | |
| 195 | const exe = addCompilerStep(b, optimize, target); | 196 | const exe = addCompilerStep(b, optimize, target); |
| | 197 | if (only_reduce) { |
| | 198 | exe.use_llvm = false; |
| | 199 | exe.use_lld = false; |
| | 200 | } |
| 196 | exe.strip = strip; | 201 | exe.strip = strip; |
| 197 | exe.pie = pie; | 202 | exe.pie = pie; |
| 198 | exe.sanitize_thread = sanitize_thread; | 203 | exe.sanitize_thread = sanitize_thread; |
| ... | @@ -236,6 +241,7 @@ pub fn build(b: *std.Build) !void { | ... | @@ -236,6 +241,7 @@ pub fn build(b: *std.Build) !void { |
| 236 | exe_options.addOption(bool, "force_gpa", force_gpa); | 241 | exe_options.addOption(bool, "force_gpa", force_gpa); |
| 237 | exe_options.addOption(bool, "only_c", only_c); | 242 | exe_options.addOption(bool, "only_c", only_c); |
| 238 | exe_options.addOption(bool, "only_core_functionality", only_c); | 243 | exe_options.addOption(bool, "only_core_functionality", only_c); |
| | 244 | exe_options.addOption(bool, "only_reduce", only_reduce); |
| 239 | | 245 | |
| 240 | if (link_libc) { | 246 | if (link_libc) { |
| 241 | exe.linkLibC(); | 247 | exe.linkLibC(); |
| ... | @@ -391,6 +397,7 @@ pub fn build(b: *std.Build) !void { | ... | @@ -391,6 +397,7 @@ pub fn build(b: *std.Build) !void { |
| 391 | test_cases_options.addOption(bool, "force_gpa", force_gpa); | 397 | test_cases_options.addOption(bool, "force_gpa", force_gpa); |
| 392 | test_cases_options.addOption(bool, "only_c", only_c); | 398 | test_cases_options.addOption(bool, "only_c", only_c); |
| 393 | test_cases_options.addOption(bool, "only_core_functionality", true); | 399 | test_cases_options.addOption(bool, "only_core_functionality", true); |
| | 400 | test_cases_options.addOption(bool, "only_reduce", false); |
| 394 | test_cases_options.addOption(bool, "enable_qemu", b.enable_qemu); | 401 | test_cases_options.addOption(bool, "enable_qemu", b.enable_qemu); |
| 395 | test_cases_options.addOption(bool, "enable_wine", b.enable_wine); | 402 | test_cases_options.addOption(bool, "enable_wine", b.enable_wine); |
| 396 | test_cases_options.addOption(bool, "enable_wasmtime", b.enable_wasmtime); | 403 | test_cases_options.addOption(bool, "enable_wasmtime", b.enable_wasmtime); |
| ... | @@ -549,6 +556,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { | ... | @@ -549,6 +556,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { |
| 549 | exe_options.addOption(bool, "enable_tracy_allocation", false); | 556 | exe_options.addOption(bool, "enable_tracy_allocation", false); |
| 550 | exe_options.addOption(bool, "value_tracing", false); | 557 | exe_options.addOption(bool, "value_tracing", false); |
| 551 | exe_options.addOption(bool, "only_core_functionality", true); | 558 | exe_options.addOption(bool, "only_core_functionality", true); |
| | 559 | exe_options.addOption(bool, "only_reduce", false); |
| 552 | | 560 | |
| 553 | const run_opt = b.addSystemCommand(&.{ | 561 | const run_opt = b.addSystemCommand(&.{ |
| 554 | "wasm-opt", | 562 | "wasm-opt", |