mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 17:35:12 +00:00
CLI: fix -fno-clang
Aro/Clang detection logic treated `-fno-clang` the same as `-fclang`.
This commit is contained in:
parent
fc4d53e2ea
commit
53775b0999
@ -1049,10 +1049,14 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
|
||||
|
||||
// Make a decision on whether to use Clang or Aro for translate-c and compiling C files.
|
||||
const c_frontend: CFrontend = blk: {
|
||||
if (!build_options.have_llvm) break :blk .aro;
|
||||
if (options.use_clang) |explicit| if (explicit) break :blk .clang;
|
||||
break :blk .clang;
|
||||
if (options.use_clang) |want_clang| {
|
||||
break :blk if (want_clang) .clang else .aro;
|
||||
}
|
||||
break :blk if (build_options.have_llvm) .clang else .aro;
|
||||
};
|
||||
if (!build_options.have_llvm and c_frontend == .clang) {
|
||||
return error.ZigCompilerNotBuiltWithLLVMExtensions;
|
||||
}
|
||||
|
||||
const is_safe_mode = switch (options.optimize_mode) {
|
||||
.Debug, .ReleaseSafe => true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user