git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit28b6d6adb295f57ab82382e734867fe4ef9dc8e8
parentf94fe6f85b
authorIsaac Freund <[email protected]>
date2026-04-22 09:21
build: add -Dllvm option

 build.zig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/build.zig b/build.zig
index 664f1af..71ca684 100644
--- a/build.zig
+++ b/build.zig
@@ -19,6 +19,7 @@ pub fn build(b: *Build) !void {
 
     const strip = b.option(bool, "strip", "Omit debug information") orelse false;
     const pie = b.option(bool, "pie", "Build a Position Independent Executable") orelse false;
+    const use_llvm = b.option(bool, "llvm", "Force use of Zig's LLVM backend and the lld linker") orelse false;
 
     const omit_frame_pointer = switch (optimize) {
         .Debug, .ReleaseSafe => false,
@@ -166,10 +167,11 @@ pub fn build(b: *Build) !void {
                 .root_source_file = b.path("river/main.zig"),
                 .target = target,
                 .optimize = optimize,
-
                 .strip = strip,
                 .link_libc = true,
             }),
+            .use_llvm = use_llvm,
+            .use_lld = use_llvm,
         });
         river.root_module.addOptions("build_options", options);
 
@@ -244,6 +246,8 @@ pub fn build(b: *Build) !void {
                 .target = target,
                 .optimize = optimize,
             }),
+            .use_llvm = use_llvm,
+            .use_lld = use_llvm,
         });
         const run_slotmap_test = b.addRunArtifact(slotmap_test);