aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Target.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-05-09 15:04:13 +0200
committerJakub Konka <kubkon@jakubkonka.com>2024-05-09 15:04:15 +0200
commit2e1fc0dd14c2897cd6fb4ff433bff2e5297272cb (patch)
tree342325fd62cc47755cf1dddf7305365d298f6fe6 /lib/std/Target.zig
parent8f202ba7c7c446da9dff4b9ca2bbfb5b21c0aa18 (diff)
downloadzig-2e1fc0dd14c2897cd6fb4ff433bff2e5297272cb.tar.gz
zig-2e1fc0dd14c2897cd6fb4ff433bff2e5297272cb.zip
handle visionos target OS tag in the compiler
* rename .xros to .visionos as agreed in the tracking issue * add support for VisionOS platform in the MachO linker
Diffstat (limited to 'lib/std/Target.zig')
-rw-r--r--lib/std/Target.zig30
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/std/Target.zig b/lib/std/Target.zig
index 2f39391c25..d98236421c 100644
--- a/lib/std/Target.zig
+++ b/lib/std/Target.zig
@@ -47,7 +47,7 @@ pub const Os = struct {
tvos,
watchos,
driverkit,
- xros,
+ visionos,
mesa3d,
contiki,
amdpal,
@@ -67,7 +67,7 @@ pub const Os = struct {
pub inline fn isDarwin(tag: Tag) bool {
return switch (tag) {
- .ios, .macos, .watchos, .tvos => true,
+ .ios, .macos, .watchos, .tvos, .visionos => true,
else => false,
};
}
@@ -108,7 +108,7 @@ pub const Os = struct {
pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 {
return switch (tag) {
.windows, .uefi => ".dll",
- .ios, .macos, .watchos, .tvos => ".dylib",
+ .ios, .macos, .watchos, .tvos, .visionos => ".dylib",
else => ".so",
};
}
@@ -178,7 +178,7 @@ pub const Os = struct {
.ios,
.tvos,
.watchos,
- .xros,
+ .visionos,
.netbsd,
.openbsd,
.dragonfly,
@@ -434,7 +434,12 @@ pub const Os = struct {
.max = .{ .major = 17, .minor = 1, .patch = 0 },
},
},
- .xros => @panic("TODO what version is xros on right now?"),
+ .visionos => .{
+ .semver = .{
+ .min = .{ .major = 1, .minor = 0, .patch = 0 },
+ .max = .{ .major = 1, .minor = 0, .patch = 0 },
+ },
+ },
.netbsd => .{
.semver = .{
.min = .{ .major = 8, .minor = 0, .patch = 0 },
@@ -531,7 +536,7 @@ pub const Os = struct {
.ios,
.tvos,
.watchos,
- .xros,
+ .visionos,
.dragonfly,
.openbsd,
.haiku,
@@ -691,7 +696,7 @@ pub const Abi = enum {
.ios,
.tvos,
.watchos,
- .xros,
+ .visionos,
.driverkit,
.shadermodel,
.liteos, // TODO: audit this
@@ -768,7 +773,7 @@ pub const ObjectFormat = enum {
pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
return switch (os_tag) {
.windows, .uefi => .coff,
- .ios, .macos, .watchos, .tvos => .macho,
+ .ios, .macos, .watchos, .tvos, .visionos => .macho,
.plan9 => .plan9,
else => switch (arch) {
.wasm32, .wasm64 => .wasm,
@@ -1633,6 +1638,7 @@ pub inline fn hasDynamicLinker(target: Target) bool {
.tvos,
.watchos,
.macos,
+ .visionos,
.uefi,
.windows,
.emscripten,
@@ -1807,7 +1813,7 @@ pub const DynamicLinker = struct {
.tvos,
.watchos,
.macos,
- .xros,
+ .visionos,
=> init("/usr/lib/dyld"),
// Operating systems in this list have been verified as not having a standard
@@ -2287,7 +2293,7 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
},
},
- .macos, .ios, .tvos, .watchos, .xros => switch (c_type) {
+ .macos, .ios, .tvos, .watchos, .visionos => switch (c_type) {
.char => return 8,
.short, .ushort => return 16,
.int, .uint, .float => return 32,
@@ -2407,7 +2413,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
else => 4,
},
- .ios, .tvos, .watchos => 4,
+ .ios, .tvos, .watchos, .visionos => 4,
else => 8,
},
@@ -2500,7 +2506,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
else => {},
},
},
- .ios, .tvos, .watchos => switch (c_type) {
+ .ios, .tvos, .watchos, .visionos => switch (c_type) {
.longdouble => return 4,
else => {},
},