build: add -Dno-llvm build option

This commit is contained in:
Isaac Freund 2024-04-20 13:27:03 +02:00
parent 033cad47bf
commit 045ee7bd25
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -18,6 +18,7 @@ pub fn build(b: *Build) !void {
const strip = b.option(bool, "strip", "Omit debug information") orelse false; 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 pie = b.option(bool, "pie", "Build a Position Independent Executable") orelse false;
const llvm = !(b.option(bool, "no-llvm", "(expirimental) Use non-LLVM x86 Zig backend") orelse false);
const omit_frame_pointer = switch (optimize) { const omit_frame_pointer = switch (optimize) {
.Debug, .ReleaseSafe => false, .Debug, .ReleaseSafe => false,
@ -169,6 +170,8 @@ pub fn build(b: *Build) !void {
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.strip = strip, .strip = strip,
.use_llvm = llvm,
.use_lld = llvm,
}); });
river.root_module.addOptions("build_options", options); river.root_module.addOptions("build_options", options);
@ -206,6 +209,8 @@ pub fn build(b: *Build) !void {
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.strip = strip, .strip = strip,
.use_llvm = llvm,
.use_lld = llvm,
}); });
riverctl.root_module.addOptions("build_options", options); riverctl.root_module.addOptions("build_options", options);
@ -229,6 +234,8 @@ pub fn build(b: *Build) !void {
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.strip = strip, .strip = strip,
.use_llvm = llvm,
.use_lld = llvm,
}); });
rivertile.root_module.addOptions("build_options", options); rivertile.root_module.addOptions("build_options", options);