From 06ee58eb8b019247c1d53005a4b2141b593b1571 Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Sat, 19 Oct 2024 11:32:22 +0100 Subject: [PATCH] Closes #106: Link libc and linked objects to static routes/tests --- build.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.zig b/build.zig index 2c06e3b..0373498 100644 --- a/build.zig +++ b/build.zig @@ -235,6 +235,16 @@ pub fn jetzigInit(b: *std.Build, exe: *std.Build.Step.Compile, options: JetzigIn exe_unit_tests.root_module.addImport(import.key_ptr.*, import.value_ptr.*); } + if (exe.root_module.link_libc == true) { + exe_static_routes.linkLibC(); + exe_unit_tests.linkLibC(); + } + + for (exe.root_module.link_objects.items) |link_object| { + try exe_static_routes.root_module.link_objects.append(b.allocator, link_object); + try exe_unit_tests.root_module.link_objects.append(b.allocator, link_object); + } + const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); const test_step = b.step("jetzig:test", "Run tests");