std.CrossTarget: add isNativeAbi()

This commit is contained in:
Isaac Freund 2020-12-12 02:14:06 +01:00
parent 307d98dc35
commit 078a64f8d9
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -500,8 +500,12 @@ pub const CrossTarget = struct {
self.dynamic_linker.get() == null and self.glibc_version == null;
}
pub fn isNativeAbi(self: CrossTarget) bool {
return self.os_tag == null and self.abi == null;
}
pub fn isNative(self: CrossTarget) bool {
return self.isNativeCpu() and self.isNativeOs() and self.abi == null;
return self.isNativeCpu() and self.isNativeOs() and self.isNativeAbi();
}
pub fn zigTriple(self: CrossTarget, allocator: *mem.Allocator) error{OutOfMemory}![]u8 {