@@ -1034,9 +1034,9 @@ function(add_swift_library name)
10341034 set (SWIFTLIB_INSTALL_IN_COMPONENT dev)
10351035 endif ()
10361036
1037- # If target SDKs are not specified, build for all known SDKs.
1037+ # If target SDKs are not specified, build for all configured SDKs.
10381038 if ("${SWIFTLIB_TARGET_SDKS} " STREQUAL "" )
1039- set (SWIFTLIB_TARGET_SDKS ${SWIFT_SDKS } )
1039+ set (SWIFTLIB_TARGET_SDKS ${SWIFT_CONFIGURED_SDKS } )
10401040 endif ()
10411041
10421042 # All Swift code depends on the standard library, except for the standard
@@ -1083,12 +1083,13 @@ function(add_swift_library name)
10831083 # If we are building this library for targets, loop through the various
10841084 # SDKs building the variants of this library.
10851085 list_intersect(
1086- "${SWIFTLIB_TARGET_SDKS} " "${SWIFT_SDKS } " SWIFTLIB_TARGET_SDKS)
1087- if (SWIFTLIB_HOST_LIBRARY)
1086+ "${SWIFTLIB_TARGET_SDKS} " "${SWIFT_CONFIGURED_SDKS } " SWIFTLIB_TARGET_SDKS)
1087+ if (SWIFTLIB_HOST_LIBRARY AND NOT SWIFT_SKIP_HOST_STDLIB )
10881088 list_union(
10891089 "${SWIFTLIB_TARGET_SDKS} " "${SWIFT_HOST_VARIANT_SDK} "
10901090 SWIFTLIB_TARGET_SDKS)
10911091 endif ()
1092+
10921093 foreach (sdk ${SWIFTLIB_TARGET_SDKS} )
10931094 set (THIN_INPUT_TARGETS)
10941095
@@ -1245,7 +1246,6 @@ function(add_swift_library name)
12451246
12461247 # Determine the subdirectory where this library will be installed.
12471248 set (resource_dir_sdk_subdir "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" )
1248-
12491249 if ("${resource_dir_sdk_subdir} " STREQUAL "" )
12501250 message (FATAL_ERROR "internal error: the variable should be non-empty" )
12511251 endif ()
@@ -1538,7 +1538,7 @@ function(add_swift_target_executable name)
15381538 swiftCore)
15391539 endif ()
15401540
1541- foreach (sdk ${SWIFT_SDKS } )
1541+ foreach (sdk ${SWIFT_CONFIGURED_SDKS } )
15421542 foreach (arch ${SWIFT_SDK_${sdk} _ARCHITECTURES})
15431543 set (VARIANT_SUFFIX "-${SWIFT_SDK_${sdk} _LIB_SUBDIR}-${arch} " )
15441544 set (VARIANT_NAME "${name}${VARIANT_SUFFIX} " )
0 commit comments