| ... | ... | @@ -79,7 +79,7 @@ pub fn build(b: *Builder) !void { |
| 79 | 79 | |
| 80 | 80 | const main_file = if (is_stage1) "src/stage1.zig" else "src/main.zig"; |
| 81 | 81 | |
| 82 | | var exe = b.addExecutable("zig", "src/main.zig"); |
| 82 | var exe = b.addExecutable("zig", main_file); |
| 83 | 83 | exe.install(); |
| 84 | 84 | exe.setBuildMode(mode); |
| 85 | 85 | exe.setTarget(target); |
| ... | ... | @@ -92,6 +92,10 @@ pub fn build(b: *Builder) !void { |
| 92 | 92 | if (is_stage1) { |
| 93 | 93 | exe.addIncludeDir("src"); |
| 94 | 94 | exe.addIncludeDir("deps/SoftFloat-3e/source/include"); |
| 95 | // This is intentionally a dummy path. stage1.zig tries to @import("compiler_rt") in case |
| 96 | // of being built by cmake. But when built by zig it's gonna get a compiler_rt so that |
| 97 | // is pointless. |
| 98 | exe.addPackagePath("compiler_rt", "src/empty.zig"); |
| 95 | 99 | |
| 96 | 100 | const softfloat = b.addStaticLibrary("softfloat", null); |
| 97 | 101 | softfloat.setBuildMode(.ReleaseFast); |
| ... | ... | @@ -188,7 +192,7 @@ pub fn build(b: *Builder) !void { |
| 188 | 192 | exe.addBuildOption([]const []const u8, "log_scopes", log_scopes); |
| 189 | 193 | exe.addBuildOption([]const []const u8, "zir_dumps", zir_dumps); |
| 190 | 194 | exe.addBuildOption(bool, "enable_tracy", tracy != null); |
| 191 | | exe.addBuildOption(bool, "is_stage1", false); |
| 195 | exe.addBuildOption(bool, "is_stage1", is_stage1); |
| 192 | 196 | if (tracy) |tracy_path| { |
| 193 | 197 | const client_cpp = fs.path.join( |
| 194 | 198 | b.allocator, |
| ... | ... | @@ -210,7 +214,7 @@ pub fn build(b: *Builder) !void { |
| 210 | 214 | const glibc_multi_dir = b.option([]const u8, "enable-foreign-glibc", "Provide directory with glibc installations to run cross compiled tests that link glibc"); |
| 211 | 215 | |
| 212 | 216 | test_stage2.addBuildOption(bool, "skip_non_native", skip_non_native); |
| 213 | | test_stage2.addBuildOption(bool, "is_stage1", false); |
| 217 | test_stage2.addBuildOption(bool, "is_stage1", is_stage1); |
| 214 | 218 | test_stage2.addBuildOption(bool, "have_llvm", enable_llvm); |
| 215 | 219 | test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled); |
| 216 | 220 | test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled); |