fix: unbreak use_llvm and pie options on macos
This commit is contained in:
parent
29c7fbebc4
commit
25eabfa4ca
1 changed files with 7 additions and 8 deletions
15
build.zig
15
build.zig
|
@ -4,19 +4,17 @@ const builtin = @import("builtin");
|
|||
pub fn build(b: *std.Build) void {
|
||||
const tracy_enabled = b.option(bool, "enable_tracy", "Enable tracy client library (default: no)") orelse false;
|
||||
const optimize_deps = b.option(bool, "optimize_deps", "Enable optimization for dependecies (default: yes)") orelse true;
|
||||
const use_llvm = b.option(bool, "use_llvm", "Enable llvm backend (default: yes)") orelse true;
|
||||
const use_tree_sitter = b.option(bool, "use_tree_sitter", "Enable tree-sitter (default: yes)") orelse true;
|
||||
const strip = b.option(bool, "strip", "Disable debug information (default: no)") orelse false;
|
||||
const pie = b.option(bool, "pie", "Produce an executable with position independent code (default: no)") orelse false;
|
||||
const dynamic_keybind = b.option(bool, "dynamic_keybind", "Build with dynamic keybinding support (default: no) (EXPERIMENTAL)") orelse false;
|
||||
const use_llvm = b.option(bool, "use_llvm", "Enable llvm backend (default: none)");
|
||||
const pie = b.option(bool, "pie", "Produce an executable with position independent code (default: none)");
|
||||
|
||||
const options = b.addOptions();
|
||||
options.addOption(bool, "enable_tracy", tracy_enabled);
|
||||
options.addOption(bool, "optimize_deps", optimize_deps);
|
||||
options.addOption(bool, "use_llvm", use_llvm);
|
||||
options.addOption(bool, "use_tree_sitter", use_tree_sitter);
|
||||
options.addOption(bool, "strip", strip);
|
||||
options.addOption(bool, "pie", pie);
|
||||
options.addOption(bool, "dynamic_keybind", dynamic_keybind);
|
||||
|
||||
const options_mod = options.createModule();
|
||||
|
@ -198,7 +196,6 @@ pub fn build(b: *std.Build) void {
|
|||
break :blk b.addRunArtifact(tests);
|
||||
};
|
||||
|
||||
|
||||
const ripgrep_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/ripgrep.zig"),
|
||||
.imports = &.{
|
||||
|
@ -281,12 +278,14 @@ pub fn build(b: *std.Build) void {
|
|||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.use_llvm = use_llvm,
|
||||
.use_lld = use_llvm,
|
||||
.strip = strip,
|
||||
});
|
||||
|
||||
exe.pie = pie;
|
||||
if (use_llvm) |value| {
|
||||
exe.use_llvm = value;
|
||||
exe.use_lld = value;
|
||||
}
|
||||
if (pie) |value| exe.pie = value;
|
||||
exe.root_module.addImport("build_options", options_mod);
|
||||
exe.root_module.addImport("flags", flags_dep.module("flags"));
|
||||
exe.root_module.addImport("cbor", cbor_mod);
|
||||
|
|
Loading…
Add table
Reference in a new issue