Skip to content

Commit 6e8ef5b

Browse files
committed
std/build.zig: add checks for UEFI
1 parent 63d56c5 commit 6e8ef5b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

std/build.zig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,13 @@ pub const Target = union(enum) {
11741174
};
11751175
}
11761176

1177+
pub fn isUefi(self: Target) bool {
1178+
return switch (self.getOs()) {
1179+
.uefi => true,
1180+
else => false,
1181+
};
1182+
}
1183+
11771184
pub fn isWasm(self: Target) bool {
11781185
return switch (self.getArch()) {
11791186
.wasm32, .wasm64 => true,
@@ -1484,7 +1491,7 @@ pub const LibExeObjStep = struct {
14841491
}
14851492

14861493
pub fn producesPdbFile(self: *LibExeObjStep) bool {
1487-
if (!self.target.isWindows()) return false;
1494+
if (!self.target.isWindows() and !self.target.isUefi()) return false;
14881495
if (self.strip) return false;
14891496
return self.isDynamicLibrary() or self.kind == .Exe;
14901497
}
@@ -1581,7 +1588,7 @@ pub const LibExeObjStep = struct {
15811588
/// Unless setOutputDir was called, this function must be called only in
15821589
/// the make step, from a step that has declared a dependency on this one.
15831590
pub fn getOutputPdbPath(self: *LibExeObjStep) []const u8 {
1584-
assert(self.target.isWindows());
1591+
assert(self.target.isWindows() or self.target.isUefi());
15851592
return fs.path.join(
15861593
self.builder.allocator,
15871594
[_][]const u8{ self.output_dir.?, self.out_pdb_filename },

0 commit comments

Comments
 (0)