diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-10-01 21:37:02 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-01 21:37:02 -0700 |
| commit | 53775b0999527ced0550f3abb32c4a4a715af74e (patch) | |
| tree | 5873cc73d3db99d5843e3c1d8e5f68224e4b1c55 /src/Compilation.zig | |
| parent | fc4d53e2ea6b41440e37caf32d2fd236d0f58c93 (diff) | |
| download | zig-53775b0999527ced0550f3abb32c4a4a715af74e.tar.gz zig-53775b0999527ced0550f3abb32c4a4a715af74e.zip | |
CLI: fix -fno-clang
Aro/Clang detection logic treated `-fno-clang` the same as `-fclang`.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index a2b02f24b0..79b93cca28 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -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, |
