When adding an option, set it as app module dependency to make it available in the app root (#129)

wch-ch32v003
Nicolas Goy 1 year ago committed by GitHub
parent 4e62e99e3c
commit 9588941915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,6 +63,9 @@ pub const EmbeddedExecutable = struct {
pub fn addOptions(exe: *EmbeddedExecutable, module_name: []const u8, options: *std.build.OptionsStep) void {
exe.inner.addOptions(module_name, options);
const app_module = exe.inner.modules.get("app").?;
const opt_module = exe.inner.modules.get(module_name).?;
app_module.dependencies.put(module_name, opt_module) catch @panic("OOM");
}
pub fn addObjectFile(exe: *EmbeddedExecutable, source_file: []const u8) void {

Loading…
Cancel
Save