aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-07-06 02:52:25 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2023-07-19 23:38:40 -0400
commitd195173ba2c06b56c1bf5554ebf0736795798c91 (patch)
treee358fa6f170400ce6a07ba00a032548a4f1263e8 /src/Compilation.zig
parent996eb01746498e0ec5e162ed40d1f3c913891150 (diff)
downloadzig-d195173ba2c06b56c1bf5554ebf0736795798c91.tar.gz
zig-d195173ba2c06b56c1bf5554ebf0736795798c91.zip
llvm: start tracking more things without relying on the llvm api
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index eb4b67933d..3a95f4831a 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -538,6 +538,7 @@ pub const InitOptions = struct {
want_lto: ?bool = null,
want_unwind_tables: ?bool = null,
use_llvm: ?bool = null,
+ use_lib_llvm: ?bool = null,
use_lld: ?bool = null,
use_clang: ?bool = null,
single_threaded: ?bool = null,
@@ -753,7 +754,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
const root_name = try arena.dupeZ(u8, options.root_name);
// Make a decision on whether to use LLVM or our own backend.
- const use_llvm = build_options.have_llvm and blk: {
+ const use_lib_llvm = options.use_lib_llvm orelse build_options.have_llvm;
+ const use_llvm = blk: {
if (options.use_llvm) |explicit|
break :blk explicit;
@@ -1161,6 +1163,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
hash.add(valgrind);
hash.add(single_threaded);
hash.add(use_llvm);
+ hash.add(use_lib_llvm);
hash.add(dll_export_fns);
hash.add(options.is_test);
hash.add(options.test_evented_io);
@@ -1444,6 +1447,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.optimize_mode = options.optimize_mode,
.use_lld = use_lld,
.use_llvm = use_llvm,
+ .use_lib_llvm = use_lib_llvm,
.link_libc = link_libc,
.link_libcpp = link_libcpp,
.link_libunwind = link_libunwind,