std.Target: Add support for specifying Android API level.

This commit is contained in:
Alex Rønne Petersen
2024-10-30 21:57:44 +01:00
parent c5395f7cd9
commit 3c1ccbdf39
7 changed files with 75 additions and 16 deletions

View File

@@ -286,7 +286,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
};
try llvm_triple.appendSlice(llvm_abi);
// This should eventually handle the Android API level too.
switch (target.os.versionRange()) {
.none,
.semver,
@@ -296,7 +295,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
ver.glibc.major,
ver.glibc.minor,
ver.glibc.patch,
}),
}) else if (target.abi.isAndroid()) try llvm_triple.writer().print("{d}", .{ver.android}),
}
return llvm_triple.toOwnedSlice();