main: call gcc to make out executable
This commit is contained in:
parent
88e505b524
commit
34481c8ea8
2 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ zig-cache/
|
||||||
*.bc
|
*.bc
|
||||||
*.ll
|
*.ll
|
||||||
*.o
|
*.o
|
||||||
|
*.out
|
||||||
|
|
|
@ -59,6 +59,13 @@ pub fn run(allocator: *std.mem.Allocator, slice: []const u8) !Result {
|
||||||
var cgen = codegen.Codegen.init(allocator, &ctx);
|
var cgen = codegen.Codegen.init(allocator, &ctx);
|
||||||
try cgen.gen(root);
|
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;
|
return Result.Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue