From 3ef5373ff243f1a4a27bb85be2339e36b4429c5a Mon Sep 17 00:00:00 2001 From: BeanCheeseBurrito Date: Sat, 9 Nov 2024 01:32:00 -0800 Subject: [PATCH] Bundle compiler rt when compiling flecs as static library --- src/Flecs.NET.Native/build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Flecs.NET.Native/build.zig b/src/Flecs.NET.Native/build.zig index da8cde7..906f673 100644 --- a/src/Flecs.NET.Native/build.zig +++ b/src/Flecs.NET.Native/build.zig @@ -141,6 +141,10 @@ pub fn compileFlecs(options: anytype, b: *Build, lib_type: LibType) void { lib.linkLibC(); + if (lib_type == LibType.Static) { + lib.bundle_compiler_rt = true; + } + lib.defineCMacro(if (options.optimize == .Debug) "FLECS_DEBUG" else "FLECS_NDEBUG", null); lib.defineCMacro(if (lib_type == LibType.Shared) "flecs_EXPORTS" else "flecs_STATIC", null);