Browse Source

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 <[email protected]>
Signed-off-by: Andrea Gottardo <[email protected]>
Andrea Gottardo 2 years ago
parent
commit
44e337cc0e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tool/gocross/autoflags.go

+ 6 - 0
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", ""))