diff options
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -31,11 +31,20 @@ pub fn build(b: *std.Build) void { // In this case the main source file is merely a path, however, in more // complicated build scripts, this could be a generated file. .target = target, - .root_source_file = b.path("src/main.zig"), + .root_source_file = b.path("src/kernel.zig"), .optimize = optimize, .code_model = .medium, }); + const platform = b.option([]const u8, "platform", "Set the target platform") orelse { + std.log.default.err("No target platform specified", .{}); + return; + }; + + const options = b.addOptions(); + options.addOption([]const u8, "platform", platform); + + exe.root_module.addOptions("config", options); exe.setLinkerScript(b.path("linker.ld")); // This declares intent for the executable to be installed into the |