diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-07 23:10:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-19 16:45:15 -0700 |
| commit | 507aae4a1a3db498ece2a3a89d74e9e24d952923 (patch) | |
| tree | db52f3b00d0def30488e7ce81adc8685c4945874 /build.zig | |
| parent | 73bbd1069a993a0e663033ea3b8cd4ed1a123566 (diff) | |
| download | zig-507aae4a1a3db498ece2a3a89d74e9e24d952923.tar.gz zig-507aae4a1a3db498ece2a3a89d74e9e24d952923.zip | |
make self-hosted the default compiler
stage1 is available behind the -fstage1 flag.
closes #89
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -64,9 +64,9 @@ pub fn build(b: *Builder) !void { const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; - const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false; + const have_stage1 = b.option(bool, "enable-stage1", "Include the stage1 compiler behind a feature flag") orelse false; const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false; - const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm); + const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (have_stage1 or static_llvm); const llvm_has_m68k = b.option( bool, "llvm-has-m68k", @@ -136,7 +136,7 @@ pub fn build(b: *Builder) !void { }; const main_file: ?[]const u8 = mf: { - if (!is_stage1) break :mf "src/main.zig"; + if (!have_stage1) break :mf "src/main.zig"; if (use_zig0) break :mf null; break :mf "src/stage1.zig"; }; @@ -247,7 +247,7 @@ pub fn build(b: *Builder) !void { } }; - if (is_stage1) { + if (have_stage1) { const softfloat = b.addStaticLibrary("softfloat", null); softfloat.setBuildMode(.ReleaseFast); softfloat.setTarget(target); @@ -359,7 +359,7 @@ pub fn build(b: *Builder) !void { exe_options.addOption(bool, "enable_tracy_callstack", tracy_callstack); exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation); exe_options.addOption(bool, "value_tracing", value_tracing); - exe_options.addOption(bool, "is_stage1", is_stage1); + exe_options.addOption(bool, "have_stage1", have_stage1); if (tracy) |tracy_path| { const client_cpp = fs.path.join( b.allocator, @@ -394,7 +394,7 @@ pub fn build(b: *Builder) !void { test_cases_options.addOption(bool, "enable_link_snapshots", enable_link_snapshots); test_cases_options.addOption(bool, "skip_non_native", skip_non_native); test_cases_options.addOption(bool, "skip_stage1", skip_stage1); - test_cases_options.addOption(bool, "is_stage1", is_stage1); + test_cases_options.addOption(bool, "have_stage1", have_stage1); test_cases_options.addOption(bool, "have_llvm", enable_llvm); test_cases_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k); test_cases_options.addOption(bool, "llvm_has_csky", llvm_has_csky); @@ -455,7 +455,6 @@ pub fn build(b: *Builder) !void { skip_libc, skip_stage1, false, - is_stage1, )); toolchain_step.dependOn(tests.addPkgTests( @@ -470,7 +469,6 @@ pub fn build(b: *Builder) !void { true, // skip_libc skip_stage1, true, // TODO get these all passing - is_stage1, )); toolchain_step.dependOn(tests.addPkgTests( @@ -485,7 +483,6 @@ pub fn build(b: *Builder) !void { true, // skip_libc skip_stage1, true, // TODO get these all passing - is_stage1, )); toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); @@ -525,7 +522,6 @@ pub fn build(b: *Builder) !void { skip_libc, skip_stage1, true, // TODO get these all passing - is_stage1, ); const test_step = b.step("test", "Run all the tests"); |
