diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-05-15 15:20:42 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-05-15 15:20:42 -0400 |
| commit | e1d4b59c5bd47c7bef3e41279c97cd36991676e2 (patch) | |
| tree | 2f441e0319bd85d74e8d69beac85810ed30f1ca0 /build.zig | |
| parent | ebb81ebe59d56a2ccb104e100b9c96df82eedc97 (diff) | |
| download | zig-e1d4b59c5bd47c7bef3e41279c97cd36991676e2.tar.gz zig-e1d4b59c5bd47c7bef3e41279c97cd36991676e2.zip | |
self-hosted: update main.zig
After this commit there are no more bit rotted files.
The testing program that was in ir.zig has been moved to main.zig
Unsupported command line options have been deleted, or error messages
added.
The compiler repl is available from the build-exe, build-lib,
build-obj commands with the --watch option.
The main zig build script now builds the self-hosted compiler
unconditionally. Linking against LLVM is behind a -Denable-llvm
flag that defaults to off.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -51,6 +51,9 @@ pub fn build(b: *Builder) !void { var exe = b.addExecutable("zig", "src-self-hosted/main.zig"); exe.setBuildMode(mode); + test_step.dependOn(&exe.step); + b.default_step.dependOn(&exe.step); + exe.install(); const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false; const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release; @@ -58,21 +61,17 @@ pub fn build(b: *Builder) !void { const skip_release_safe = b.option(bool, "skip-release-safe", "Main test suite skips release-safe builds") orelse skip_release; const skip_non_native = b.option(bool, "skip-non-native", "Main test suite skips non-native builds") orelse false; const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false; - const skip_self_hosted = (b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") orelse false) or true; // TODO evented I/O good enough that this passes everywhere - if (!skip_self_hosted) { - test_step.dependOn(&exe.step); - } const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; - if (!only_install_lib_files and !skip_self_hosted) { + const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse false; + if (enable_llvm) { var ctx = parseConfigH(b, config_h_text); ctx.llvm = try findLLVM(b, ctx.llvm_config_exe); try configureStage2(b, exe, ctx); - - b.default_step.dependOn(&exe.step); - exe.install(); } + const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse false; + if (link_libc) exe.linkLibC(); b.installDirectory(InstallDirectoryOptions{ .source_dir = "lib", |
