From 44e337cc0e10969deda03b9ee44ebe6639c5523d Mon Sep 17 00:00:00 2001 From: Andrea Gottardo Date: Fri, 16 Feb 2024 11:14:17 -0800 Subject: [PATCH] tool/gocross: pass flags for visionOS and visionOS Simulator (#11127) Adds logic in gocross to detect environment variables and pass the right flags so that the backend can be built with the visionOS SDK. Signed-off-by: Andrea Gottardo Signed-off-by: Andrea Gottardo --- tool/gocross/autoflags.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go index 825f86965..e8707a55f 100644 --- a/tool/gocross/autoflags.go +++ b/tool/gocross/autoflags.go @@ -128,6 +128,12 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ // Minimum OS version being targeted, results in // e.g. -mmacosx-version-min=11.3, -miphoneos-version-min=15.0 switch { + case env.IsSet("XROS_DEPLOYMENT_TARGET"): + if env.Get("TARGET_DEVICE_PLATFORM_NAME", "") == "xrsimulator" { + xcodeFlags = append(xcodeFlags, "-mtargetos=xros"+env.Get("XROS_DEPLOYMENT_TARGET", "")+"-simulator") + } else { + xcodeFlags = append(xcodeFlags, "-mtargetos=xros"+env.Get("XROS_DEPLOYMENT_TARGET", "")) + } case env.IsSet("IPHONEOS_DEPLOYMENT_TARGET"): if env.Get("TARGET_DEVICE_PLATFORM_NAME", "") == "iphonesimulator" { xcodeFlags = append(xcodeFlags, "-miphonesimulator-version-min="+env.Get("IPHONEOS_DEPLOYMENT_TARGET", ""))