diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-09 17:24:28 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-10 11:17:29 -0700 |
| commit | 8679c7a6070c3aa38bcf8e3fad47ac041cb93c90 (patch) | |
| tree | f4a7bb27498fd9ab9867b1ea602cd75f2218e938 /src/Compilation.zig | |
| parent | 6e0904504155d3cba80955c108116170fd739aec (diff) | |
| download | zig-8679c7a6070c3aa38bcf8e3fad47ac041cb93c90.tar.gz zig-8679c7a6070c3aa38bcf8e3fad47ac041cb93c90.zip | |
Compilation: default to self-hosted backend when not using libllvm
When not using libllvm, it means the compiler is not capable of
producing an object file or executable, making the self-hosted backends
be a better default.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 4e43c7fccb..b10adad01b 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -841,6 +841,12 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { if (options.main_mod == null) break :blk false; + // If we cannot use LLVM libraries, then our own backends will be a + // better default since the LLVM backend can only produce bitcode + // and not an object file or executable. + if (!use_lib_llvm) + break :blk false; + // If LLVM does not support the target, then we can't use it. if (!target_util.hasLlvmSupport(options.target, options.target.ofmt)) break :blk false; |
