From e4709e0c7360f106ae32573e5a75795fc0add47d Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Thu, 28 Mar 2024 19:41:45 +0000 Subject: [PATCH] Replicate exe imports in routes and static routes generator Allow using dependencies added to main exe in views. --- build.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.zig b/build.zig index 8407f87..890b424 100644 --- a/build.zig +++ b/build.zig @@ -148,6 +148,12 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn exe.root_module.addImport("routes", routes_module); routes_module.addImport("jetzig", jetzig_module); + var it = exe.root_module.import_table.iterator(); + while (it.next()) |import| { + routes_module.addImport(import.key_ptr.*, import.value_ptr.*); + exe_static_routes.root_module.addImport(import.key_ptr.*, import.value_ptr.*); + } + exe_static_routes.root_module.addImport("routes", routes_module); exe_static_routes.root_module.addImport("jetzig", jetzig_module); exe_static_routes.root_module.addImport("zmpl", zmpl_module);