aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-08 13:31:39 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-08 13:31:39 -0700
commit24cbf1c70679ee81d45fb7a8ba5c48fdb77cbd5c (patch)
treeb367c26e62d4a62d4cdf5e0ef3e801308a25d39d /src
parenta482b82e2d4fdcd0a9a8683e403ced789c7f98a3 (diff)
downloadzig-24cbf1c70679ee81d45fb7a8ba5c48fdb77cbd5c.tar.gz
zig-24cbf1c70679ee81d45fb7a8ba5c48fdb77cbd5c.zip
always use codeview (pdb) when object_format is PE/COFF
Previously, when mixing Zig and C/C++ code for windows-gnu targets, zig would get codeview format but the C/C++ code would not get any debug info. Now, C/C++ code properly emits debug info in codeview format and everything just works.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 8efc911796..fbccb21557 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -2037,6 +2037,10 @@ pub fn addCCArgs(
if (!comp.bin_file.options.strip) {
try argv.append("-g");
+ switch (comp.bin_file.options.object_format) {
+ .coff, .pe => try argv.append("-gcodeview"),
+ else => {},
+ }
}
if (comp.haveFramePointer()) {