Build: fix producesPdbFile logic (#15756)

Fixes bug causing ReleaseSmall to fail on Windows.

Due to the change in default behavior of ReleaseSmall, debug info are
stripped by default. However because `Compile.create` still defaults to
null, `producesPdbFile` will report true for
`lib/std/Build/Step/InstallArtifact.zig` causing it to fail on copying a
file that does not exist. This commit change the default of strip
depending on `optimize`.
This commit is contained in:
xEgoist 2023-06-03 20:45:08 +00:00 committed by GitHub
parent 105078519a
commit ff57a264ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -691,7 +691,7 @@ pub fn isStaticLibrary(self: *Compile) bool {
pub fn producesPdbFile(self: *Compile) bool {
if (!self.target.isWindows() and !self.target.isUefi()) return false;
if (self.target.getObjectFormat() == .c) return false;
if (self.strip == true) return false;
if (self.strip == true or (self.strip == null and self.optimize == .ReleaseSmall)) return false;
return self.isDynamicLibrary() or self.kind == .exe or self.kind == .@"test";
}