| ... | ... | @@ -49,11 +49,6 @@ pub fn build(b: *Builder) !void { |
| 49 | 49 | |
| 50 | 50 | const fmt_build_zig = b.addFmt(&[_][]const u8{"build.zig"}); |
| 51 | 51 | |
| 52 | | var exe = b.addExecutable("zig", "src-self-hosted/main.zig"); |
| 53 | | exe.setBuildMode(mode); |
| 54 | | test_step.dependOn(&exe.step); |
| 55 | | b.default_step.dependOn(&exe.step); |
| 56 | | |
| 57 | 52 | const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false; |
| 58 | 53 | const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release; |
| 59 | 54 | const skip_release_fast = b.option(bool, "skip-release-fast", "Main test suite skips release-fast builds") orelse skip_release; |
| ... | ... | @@ -63,29 +58,37 @@ pub fn build(b: *Builder) !void { |
| 63 | 58 | |
| 64 | 59 | const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false; |
| 65 | 60 | const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse false; |
| 66 | | if (enable_llvm) { |
| 67 | | var ctx = parseConfigH(b, config_h_text); |
| 68 | | ctx.llvm = try findLLVM(b, ctx.llvm_config_exe); |
| 69 | 61 | |
| 70 | | try configureStage2(b, exe, ctx); |
| 71 | | } |
| 72 | 62 | if (!only_install_lib_files) { |
| 73 | | exe.install(); |
| 74 | | } |
| 75 | | const tracy = b.option([]const u8, "tracy", "Enable Tracy integration. Supply path to Tracy source"); |
| 76 | | const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse false; |
| 77 | | if (link_libc) exe.linkLibC(); |
| 63 | var exe = b.addExecutable("zig", "src-self-hosted/main.zig"); |
| 64 | exe.setBuildMode(mode); |
| 65 | test_step.dependOn(&exe.step); |
| 66 | b.default_step.dependOn(&exe.step); |
| 78 | 67 | |
| 79 | | exe.addBuildOption(bool, "enable_tracy", tracy != null); |
| 80 | | if (tracy) |tracy_path| { |
| 81 | | const client_cpp = fs.path.join( |
| 82 | | b.allocator, |
| 83 | | &[_][]const u8{ tracy_path, "TracyClient.cpp" }, |
| 84 | | ) catch unreachable; |
| 85 | | exe.addIncludeDir(tracy_path); |
| 86 | | exe.addCSourceFile(client_cpp, &[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" }); |
| 87 | | exe.linkSystemLibraryName("c++"); |
| 88 | | exe.linkLibC(); |
| 68 | if (enable_llvm) { |
| 69 | var ctx = parseConfigH(b, config_h_text); |
| 70 | ctx.llvm = try findLLVM(b, ctx.llvm_config_exe); |
| 71 | |
| 72 | try configureStage2(b, exe, ctx); |
| 73 | } |
| 74 | if (!only_install_lib_files) { |
| 75 | exe.install(); |
| 76 | } |
| 77 | const tracy = b.option([]const u8, "tracy", "Enable Tracy integration. Supply path to Tracy source"); |
| 78 | const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse false; |
| 79 | if (link_libc) exe.linkLibC(); |
| 80 | |
| 81 | exe.addBuildOption(bool, "enable_tracy", tracy != null); |
| 82 | if (tracy) |tracy_path| { |
| 83 | const client_cpp = fs.path.join( |
| 84 | b.allocator, |
| 85 | &[_][]const u8{ tracy_path, "TracyClient.cpp" }, |
| 86 | ) catch unreachable; |
| 87 | exe.addIncludeDir(tracy_path); |
| 88 | exe.addCSourceFile(client_cpp, &[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" }); |
| 89 | exe.linkSystemLibraryName("c++"); |
| 90 | exe.linkLibC(); |
| 91 | } |
| 89 | 92 | } |
| 90 | 93 | |
| 91 | 94 | b.installDirectory(InstallDirectoryOptions{ |