28 lines
678 B
Plaintext
28 lines
678 B
Plaintext
const std = #import("std");
|
|
const assert = std.assert;
|
|
const Executable = std.build.Executable;
|
|
|
|
const main = fn () s32 {
|
|
const argument_count = std.start.argument_count;
|
|
const argument_values = std.start.argument_values;
|
|
assert(ok = argument_count == 3);
|
|
|
|
const executable = Executable{
|
|
.target = .{
|
|
.cpu = .x86_64,
|
|
.os = .linux,
|
|
.abi = .gnu,
|
|
},
|
|
.main_source_path = "src/main.nat",
|
|
};
|
|
|
|
const compiler_path = argument_values[2];
|
|
|
|
if (executable.compile(compiler_path)) {
|
|
return 0;
|
|
} else {
|
|
std.print(bytes = "Executable failed to compile!\n");
|
|
return 1;
|
|
}
|
|
}
|