From dabe3d8fb2a7193fd47f6172c16171bfdf701a6f Mon Sep 17 00:00:00 2001 From: Andrea Gottardo Date: Wed, 11 Sep 2024 15:11:35 -0700 Subject: [PATCH] tool/gocross: allow building for tvOS Simulator Updates tailscale/corp#23087 Allows gocross to set the proper flags to build ipn-go-bridge on tvOS Simulator. --- tool/gocross/autoflags.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tool/gocross/autoflags.go b/tool/gocross/autoflags.go index c66cab55a..7ad1e3bb5 100644 --- a/tool/gocross/autoflags.go +++ b/tool/gocross/autoflags.go @@ -146,7 +146,11 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ case env.IsSet("MACOSX_DEPLOYMENT_TARGET"): xcodeFlags = append(xcodeFlags, "-mmacosx-version-min="+env.Get("MACOSX_DEPLOYMENT_TARGET", "")) case env.IsSet("TVOS_DEPLOYMENT_TARGET"): - xcodeFlags = append(xcodeFlags, "-mtvos-version-min="+env.Get("TVOS_DEPLOYMENT_TARGET", "")) + if env.Get("TARGET_DEVICE_PLATFORM_NAME", "") == "appletvsimulator" { + xcodeFlags = append(xcodeFlags, "-mtvos-version-min="+env.Get("TVOS_DEPLOYMENT_TARGET", "")+"-simulator") + } else { + xcodeFlags = append(xcodeFlags, "-mtvos-version-min="+env.Get("TVOS_DEPLOYMENT_TARGET", "")) + } default: return nil, nil, fmt.Errorf("invoked by Xcode but couldn't figure out deployment target. Did Xcode change its envvars again?") }