std/build.zig: add checks for UEFI

This commit is contained in:
Nick Erdmann 2019-07-26 15:42:50 +02:00
parent 63d56c532d
commit 6e8ef5b6f2
No known key found for this signature in database
GPG Key ID: C174038EAF6578B2

View File

@ -1174,6 +1174,13 @@ pub const Target = union(enum) {
};
}
pub fn isUefi(self: Target) bool {
return switch (self.getOs()) {
.uefi => true,
else => false,
};
}
pub fn isWasm(self: Target) bool {
return switch (self.getArch()) {
.wasm32, .wasm64 => true,
@ -1484,7 +1491,7 @@ pub const LibExeObjStep = struct {
}
pub fn producesPdbFile(self: *LibExeObjStep) bool {
if (!self.target.isWindows()) return false;
if (!self.target.isWindows() and !self.target.isUefi()) return false;
if (self.strip) return false;
return self.isDynamicLibrary() or self.kind == .Exe;
}
@ -1581,7 +1588,7 @@ pub const LibExeObjStep = struct {
/// Unless setOutputDir was called, this function must be called only in
/// the make step, from a step that has declared a dependency on this one.
pub fn getOutputPdbPath(self: *LibExeObjStep) []const u8 {
assert(self.target.isWindows());
assert(self.target.isWindows() or self.target.isUefi());
return fs.path.join(
self.builder.allocator,
[_][]const u8{ self.output_dir.?, self.out_pdb_filename },