Skip to content

Commit f02659d

Browse files
committed
std.Target: Add hurdTuple() and hurdTupleSimple() functions.
These serve the same purpose as the linuxTriple() and linuxTripleSimple() functions, i.e. to return a triple understood by the GNU ecosystem.
1 parent 8594f17 commit f02659d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/std/Target.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,14 @@ pub fn zigTriple(target: Target, allocator: Allocator) Allocator.Error![]u8 {
20232023
return Query.fromTarget(target).zigTriple(allocator);
20242024
}
20252025

2026+
pub fn hurdTupleSimple(allocator: Allocator, arch: Cpu.Arch, abi: Abi) ![]u8 {
2027+
return std.fmt.allocPrint(allocator, "{s}-{s}", .{ @tagName(arch), @tagName(abi) });
2028+
}
2029+
2030+
pub fn hurdTuple(target: Target, allocator: Allocator) ![]u8 {
2031+
return hurdTupleSimple(allocator, target.cpu.arch, target.abi);
2032+
}
2033+
20262034
pub fn linuxTripleSimple(allocator: Allocator, arch: Cpu.Arch, os_tag: Os.Tag, abi: Abi) ![]u8 {
20272035
return std.fmt.allocPrint(allocator, "{s}-{s}-{s}", .{ @tagName(arch), @tagName(os_tag), @tagName(abi) });
20282036
}

0 commit comments

Comments
 (0)