aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-06 19:50:53 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-06 19:50:53 -0700
commitf253822415304fc069f68452f7f4abbded58a24e (patch)
tree2333e64c7d81b2948ec30b29c659f90b066e5c45 /src/main.zig
parentec212c82bef3cbf01517eece67a8599348c7ac86 (diff)
downloadzig-f253822415304fc069f68452f7f4abbded58a24e.tar.gz
zig-f253822415304fc069f68452f7f4abbded58a24e.zip
stage2: do not set clang_passthrough_mode for `zig run`
Thanks to @g-w1 for discovering this bug. closes #8450
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index a40be84e56..5fb74db61f 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1815,6 +1815,11 @@ fn buildOutputType(
@import("codegen/llvm/bindings.zig").ParseCommandLineOptions(argv.len, &argv);
}
+ const clang_passthrough_mode = switch (arg_mode) {
+ .cc, .cpp, .translate_c => true,
+ else => false,
+ };
+
gimmeMoreOfThoseSweetSweetFileDescriptors();
const comp = Compilation.create(gpa, .{
@@ -1886,7 +1891,7 @@ fn buildOutputType(
.function_sections = function_sections,
.self_exe_path = self_exe_path,
.thread_pool = &thread_pool,
- .clang_passthrough_mode = arg_mode != .build,
+ .clang_passthrough_mode = clang_passthrough_mode,
.clang_preprocessor_mode = clang_preprocessor_mode,
.version = optional_version,
.libc_installation = if (libc_installation) |*lci| lci else null,