authorgravatar for n@nirf.deNick Erdmann <n@nirf.de> 2019-07-26 15:42:50+02:00
committergravatar for n@nirf.deNick Erdmann <n@nirf.de> 2019-07-29 00:21:21+02:00
log6e8ef5b6f2205ada3f2c1b4769aefdfc61aca39e
tree8abbdeedab7263cb8f8b99f27e447c3f4fd8b243
parent63d56c532d4485ff03f59ae0e79043e23bcc63d9
signaturelock-open Commit is signed but in an unrecognized format.

std/build.zig: add checks for UEFI


1 files changed, 9 insertions(+), 2 deletions(-)

std/build.zig+9-2
...@@ -1174,6 +1174,13 @@ pub const Target = union(enum) {...@@ -1174,6 +1174,13 @@ pub const Target = union(enum) {
1174 };1174 };
1175 }1175 }
11761176
1177 pub fn isUefi(self: Target) bool {
1178 return switch (self.getOs()) {
1179 .uefi => true,
1180 else => false,
1181 };
1182 }
1183
1177 pub fn isWasm(self: Target) bool {1184 pub fn isWasm(self: Target) bool {
1178 return switch (self.getArch()) {1185 return switch (self.getArch()) {
1179 .wasm32, .wasm64 => true,1186 .wasm32, .wasm64 => true,
...@@ -1484,7 +1491,7 @@ pub const LibExeObjStep = struct {...@@ -1484,7 +1491,7 @@ pub const LibExeObjStep = struct {
1484 }1491 }
14851492
1486 pub fn producesPdbFile(self: *LibExeObjStep) bool {1493 pub fn producesPdbFile(self: *LibExeObjStep) bool {
1487 if (!self.target.isWindows()) return false;1494 if (!self.target.isWindows() and !self.target.isUefi()) return false;
1488 if (self.strip) return false;1495 if (self.strip) return false;
1489 return self.isDynamicLibrary() or self.kind == .Exe;1496 return self.isDynamicLibrary() or self.kind == .Exe;
1490 }1497 }
...@@ -1581,7 +1588,7 @@ pub const LibExeObjStep = struct {...@@ -1581,7 +1588,7 @@ pub const LibExeObjStep = struct {
1581 /// Unless setOutputDir was called, this function must be called only in1588 /// Unless setOutputDir was called, this function must be called only in
1582 /// the make step, from a step that has declared a dependency on this one.1589 /// the make step, from a step that has declared a dependency on this one.
1583 pub fn getOutputPdbPath(self: *LibExeObjStep) []const u8 {1590 pub fn getOutputPdbPath(self: *LibExeObjStep) []const u8 {
1584 assert(self.target.isWindows());1591 assert(self.target.isWindows() or self.target.isUefi());
1585 return fs.path.join(1592 return fs.path.join(
1586 self.builder.allocator,1593 self.builder.allocator,
1587 [_][]const u8{ self.output_dir.?, self.out_pdb_filename },1594 [_][]const u8{ self.output_dir.?, self.out_pdb_filename },