@@ -478,6 +478,13 @@ function(is_sdk_requested name result_var_name)
478
478
endif ()
479
479
endfunction ()
480
480
481
+ if (XCODE )
482
+ # FIXME: Cannot cross-compile the standard library using Xcode. Xcode
483
+ # insists on passing -mmacosx-version-min to the compiler, and we need
484
+ # to pass -mios-version-min. Clang sees both options and complains.
485
+ set (SWIFT_SDKS "OSX" )
486
+ endif ()
487
+
481
488
# FIXME: the parameters we specify in SWIFT_SDKS are lacking architecture specifics,
482
489
# so we need to hard-code it. For example, the SDK for Android is just 'ANDROID',
483
490
# which we assume below to be armv7.
@@ -592,17 +599,8 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
592
599
# Compatible cross-compile SDKS for Darwin OSes: IOS, IOS_SIMULATOR, TVOS,
593
600
# TVOS_SIMULATOR, WATCHOS, WATCHOS_SIMULATOR (archs hardcoded below).
594
601
595
- if (XCODE )
596
- # FIXME: Cannot cross-compile stdlib using Xcode. Xcode insists on
597
- # passing -mmacosx-version-min to the compiler, and we want to pass
598
- # -mios-version-min. Clang sees both options and complains.
599
- set (swift_can_crosscompile_stdlib FALSE )
600
- else ()
601
- set (swift_can_crosscompile_stdlib TRUE )
602
- endif ()
603
-
604
602
is_sdk_requested (IOS swift_build_ios )
605
- if (swift_build_ios AND ${swift_can_crosscompile_stdlib} )
603
+ if (swift_build_ios )
606
604
configure_sdk_darwin (
607
605
IOS "iOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS} "
608
606
iphoneos ios ios "armv7;armv7s;arm64" )
@@ -612,7 +610,7 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
612
610
endif ()
613
611
614
612
is_sdk_requested (IOS_SIMULATOR swift_build_ios_simulator )
615
- if (swift_build_ios_simulator AND ${swift_can_crosscompile_stdlib} )
613
+ if (swift_build_ios_simulator )
616
614
configure_sdk_darwin (
617
615
IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS} "
618
616
iphonesimulator ios-simulator ios "i386;x86_64" )
@@ -625,7 +623,7 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
625
623
endif ()
626
624
627
625
is_sdk_requested (TVOS swift_build_tvos )
628
- if (swift_build_tvos AND ${swift_can_crosscompile_stdlib} )
626
+ if (swift_build_tvos )
629
627
configure_sdk_darwin (
630
628
TVOS "tvOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS} "
631
629
appletvos tvos tvos "arm64" )
@@ -635,7 +633,7 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
635
633
endif ()
636
634
637
635
is_sdk_requested (TVOS_SIMULATOR swift_build_tvos_simulator )
638
- if (swift_build_tvos_simulator AND ${swift_can_crosscompile_stdlib} )
636
+ if (swift_build_tvos_simulator )
639
637
configure_sdk_darwin (
640
638
TVOS_SIMULATOR "tvOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS} "
641
639
appletvsimulator tvos-simulator tvos "x86_64" )
@@ -648,7 +646,7 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
648
646
endif ()
649
647
650
648
is_sdk_requested (WATCHOS swift_build_watchos )
651
- if (swift_build_watchos AND ${swift_can_crosscompile_stdlib} )
649
+ if (swift_build_watchos )
652
650
configure_sdk_darwin (
653
651
WATCHOS "watchOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS} "
654
652
watchos watchos watchos "armv7k" )
@@ -658,7 +656,7 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
658
656
endif ()
659
657
660
658
is_sdk_requested (WATCHOS_SIMULATOR swift_build_watchos_simulator )
661
- if (swift_build_watchos_simulator AND ${swift_can_crosscompile_stdlib} )
659
+ if (swift_build_watchos_simulator )
662
660
configure_sdk_darwin (
663
661
WATCHOS_SIMULATOR "watchOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS} "
664
662
watchsimulator watchos-simulator watchos "i386" )
0 commit comments