commit c2de3bdc12885a456e4c616aa8043ab01ffecb11 (tree)
parent ad95eecf375ca051c49e9eb183b23eedca994927
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 8 Dec 2020 13:31:39 -0700
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:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/Compilation.zig b/src/Compilation.zig
@@ -1989,6 +1989,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()) {