@@ -240,7 +240,10 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
240
240
// Remove the `SDKROOT` environment variable if it's clearly set for the wrong platform, which
241
241
// may occur when we're linking a custom build script while targeting iOS for example.
242
242
if let Ok ( sdkroot) = env:: var ( "SDKROOT" ) {
243
- if sdkroot. contains ( "iPhoneOS.platform" ) || sdkroot. contains ( "iPhoneSimulator.platform" )
243
+ if sdkroot. contains ( "iPhoneOS.platform" )
244
+ || sdkroot. contains ( "iPhoneSimulator.platform" )
245
+ || sdkroot. contains ( "AppleTVOS.platform" )
246
+ || sdkroot. contains ( "AppleTVSimulator.platform" )
244
247
{
245
248
env_remove. push ( "SDKROOT" . into ( ) )
246
249
}
@@ -249,6 +252,7 @@ fn link_env_remove(arch: Arch, os: &'static str) -> StaticCow<[StaticCow<str>]>
249
252
// "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
250
253
// although this is apparently ignored when using the linker at "/usr/bin/ld".
251
254
env_remove. push ( "IPHONEOS_DEPLOYMENT_TARGET" . into ( ) ) ;
255
+ env_remove. push ( "TVOS_DEPLOYMENT_TARGET" . into ( ) ) ;
252
256
env_remove. into ( )
253
257
} else {
254
258
// Otherwise if cross-compiling for a different OS/SDK, remove any part
@@ -279,6 +283,16 @@ pub fn ios_llvm_target(arch: Arch) -> String {
279
283
format ! ( "{}-apple-ios{}.{}.0" , arch. target_name( ) , major, minor)
280
284
}
281
285
286
+ pub fn tvos_sim_llvm_target ( arch : Arch ) -> String {
287
+ let ( major, minor) = tvos_deployment_target ( ) ;
288
+ format ! ( "{}-apple-tvos{}.{}.0-simulator" , arch. target_name( ) , major, minor)
289
+ }
290
+
291
+ pub fn tvos_llvm_target ( arch : Arch ) -> String {
292
+ let ( major, minor) = tvos_deployment_target ( ) ;
293
+ format ! ( "{}-apple-tvos{}.{}.0" , arch. target_name( ) , major, minor)
294
+ }
295
+
282
296
fn ios_lld_platform_version ( ) -> String {
283
297
let ( major, minor) = ios_deployment_target ( ) ;
284
298
format ! ( "{major}.{minor}" )
0 commit comments