| ... | @@ -79,7 +79,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -79,7 +79,7 @@ pub fn build(b: *Builder) !void { |
| 79 | | 79 | |
| 80 | const main_file = if (is_stage1) "src/stage1.zig" else "src/main.zig"; | 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 | exe.install(); | 83 | exe.install(); |
| 84 | exe.setBuildMode(mode); | 84 | exe.setBuildMode(mode); |
| 85 | exe.setTarget(target); | 85 | exe.setTarget(target); |
| ... | @@ -92,6 +92,10 @@ pub fn build(b: *Builder) !void { | ... | @@ -92,6 +92,10 @@ pub fn build(b: *Builder) !void { |
| 92 | if (is_stage1) { | 92 | if (is_stage1) { |
| 93 | exe.addIncludeDir("src"); | 93 | exe.addIncludeDir("src"); |
| 94 | exe.addIncludeDir("deps/SoftFloat-3e/source/include"); | 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 | const softfloat = b.addStaticLibrary("softfloat", null); | 100 | const softfloat = b.addStaticLibrary("softfloat", null); |
| 97 | softfloat.setBuildMode(.ReleaseFast); | 101 | softfloat.setBuildMode(.ReleaseFast); |
| ... | @@ -188,7 +192,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -188,7 +192,7 @@ pub fn build(b: *Builder) !void { |
| 188 | exe.addBuildOption([]const []const u8, "log_scopes", log_scopes); | 192 | exe.addBuildOption([]const []const u8, "log_scopes", log_scopes); |
| 189 | exe.addBuildOption([]const []const u8, "zir_dumps", zir_dumps); | 193 | exe.addBuildOption([]const []const u8, "zir_dumps", zir_dumps); |
| 190 | exe.addBuildOption(bool, "enable_tracy", tracy != null); | 194 | exe.addBuildOption(bool, "enable_tracy", tracy != null); |
| 191 | exe.addBuildOption(bool, "is_stage1", false); | 195 | exe.addBuildOption(bool, "is_stage1", is_stage1); |
| 192 | if (tracy) |tracy_path| { | 196 | if (tracy) |tracy_path| { |
| 193 | const client_cpp = fs.path.join( | 197 | const client_cpp = fs.path.join( |
| 194 | b.allocator, | 198 | b.allocator, |
| ... | @@ -210,7 +214,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -210,7 +214,7 @@ pub fn build(b: *Builder) !void { |
| 210 | const glibc_multi_dir = b.option([]const u8, "enable-foreign-glibc", "Provide directory with glibc installations to run cross compiled tests that link glibc"); | 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 | test_stage2.addBuildOption(bool, "skip_non_native", skip_non_native); | 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 | test_stage2.addBuildOption(bool, "have_llvm", enable_llvm); | 218 | test_stage2.addBuildOption(bool, "have_llvm", enable_llvm); |
| 215 | test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled); | 219 | test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled); |
| 216 | test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled); | 220 | test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled); |