aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 4efb845a82..8e2da5aec4 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -527,6 +527,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
if (options.root_pkg == null)
break :blk false;
+ // If we are outputting .c code we must use Zig backend.
+ if (ofmt == .c)
+ break :blk false;
+
// If we are the stage1 compiler, we depend on the stage1 c++ llvm backend
// to compile zig code.
if (build_options.is_stage1)