mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
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.
This commit is contained in:
parent
6e09045041
commit
8679c7a607
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user