From 95889419155b7ffb1b11055549540096eaa2a6c5 Mon Sep 17 00:00:00 2001 From: Nicolas Goy Date: Tue, 16 May 2023 06:32:26 +0200 Subject: [PATCH] When adding an option, set it as app module dependency to make it available in the app root (#129) --- build.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.zig b/build.zig index 86231e9..55e2ac8 100644 --- a/build.zig +++ b/build.zig @@ -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 {