main: call gcc to make out executable

This commit is contained in:
Luna 2019-09-29 13:16:49 -03:00
parent 88e505b524
commit 34481c8ea8
2 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ zig-cache/
*.bc
*.ll
*.o
*.out

View File

@ -59,6 +59,13 @@ pub fn run(allocator: *std.mem.Allocator, slice: []const u8) !Result {
var cgen = codegen.Codegen.init(allocator, &ctx);
try cgen.gen(root);
var child = try std.ChildProcess.init(
[_][]const u8{ "gcc", "src/entry.c", "outpath.o", "-o", "a.out" },
allocator,
);
try child.spawn();
_ = try child.wait();
return Result.Ok;
}