Move bootstrap away from src

This commit is contained in:
David Gonzalez Martin 2023-11-20 09:36:04 -06:00
parent 3ae6193706
commit 073f636ee9
16 changed files with 1 additions and 12 deletions

View File

@ -8,7 +8,7 @@ pub fn build(b: *std.Build) !void {
const use_llvm = b.option(bool, "use_llvm", "Use LLVM as the backend for generate the compiler binary") orelse false;
const exe = b.addExecutable(.{
.name = "nativity",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = .{ .path = "bootstrap/main.zig" },
.target = target,
.optimize = optimization,
.use_llvm = use_llvm,
@ -24,12 +24,6 @@ pub fn build(b: *std.Build) !void {
.install_subdir = "lib",
});
const zig_tests = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimization,
});
const run_command = b.addRunArtifact(exe);
const debug_command = switch (@import("builtin").os.tag) {
@ -58,18 +52,13 @@ pub fn build(b: *std.Build) !void {
else => @compileError("OS not supported"),
};
const test_command = b.addRunArtifact(zig_tests);
if (b.args) |args| {
run_command.addArgs(args);
test_command.addArgs(args);
debug_command.addArgs(args);
}
const run_step = b.step("run", "Test the Nativity compiler");
run_step.dependOn(&run_command.step);
const test_step = b.step("test", "Test the Nativity compiler");
test_step.dependOn(&test_command.step);
const debug_step = b.step("debug", "Debug the Nativity compiler");
debug_step.dependOn(&debug_command.step);
}