@@ -1347,7 +1347,7 @@ endfunction()
1347
1347
# Sources to add into this library.
1348
1348
function (add_swift_library name )
1349
1349
set (SWIFTLIB_options
1350
- SHARED IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY TARGET_LIBRARY
1350
+ SHARED IS_STDLIB IS_STDLIB_CORE IS_SDK_OVERLAY TARGET_LIBRARY IS_HOST
1351
1351
API_NOTES_NON_OVERLAY DONT_EMBED_BITCODE )
1352
1352
cmake_parse_arguments (SWIFTLIB
1353
1353
"${SWIFTLIB_options} "
@@ -1426,6 +1426,9 @@ function(add_swift_library name)
1426
1426
# SDKs building the variants of this library.
1427
1427
list_intersect (
1428
1428
"${SWIFTLIB_TARGET_SDKS} " "${SWIFT_SDKS} " SWIFTLIB_TARGET_SDKS )
1429
+ if (SWIFTLIB_IS_HOST )
1430
+ list_union ("${SWIFTLIB_TARGET_SDKS} " "${SWIFT_HOST_VARIANT_SDK} " SWIFTLIB_TARGET_SDKS )
1431
+ endif ()
1429
1432
foreach (sdk ${SWIFTLIB_TARGET_SDKS} )
1430
1433
set (THIN_INPUT_TARGETS )
1431
1434
@@ -1632,13 +1635,15 @@ function(add_swift_library name)
1632
1635
if (SWIFTLIB_IS_STDLIB )
1633
1636
foreach (arch ${SWIFT_SDK_${sdk}_ARCHITECTURES} )
1634
1637
set (VARIANT_SUFFIX "-${SWIFT_SDK_${sdk} _LIB_SUBDIR}-${arch} " )
1635
- add_dependencies ("swift-stdlib${VARIANT_SUFFIX} "
1636
- ${lipo_target}
1637
- ${lipo_target_static} )
1638
- if (NOT "${name} " STREQUAL "swiftStdlibCollectionUnittest" )
1639
- add_dependencies ("swift-test-stdlib${VARIANT_SUFFIX} "
1638
+ if (TARGET "swift-stdlib${VARIANT_SUFFIX} " AND TARGET "swift-test-stdlib${VARIANT_SUFFIX} " )
1639
+ add_dependencies ("swift-stdlib${VARIANT_SUFFIX} "
1640
1640
${lipo_target}
1641
1641
${lipo_target_static} )
1642
+ if (NOT "${name} " STREQUAL "swiftStdlibCollectionUnittest" )
1643
+ add_dependencies ("swift-test-stdlib${VARIANT_SUFFIX} "
1644
+ ${lipo_target}
1645
+ ${lipo_target_static} )
1646
+ endif ()
1642
1647
endif ()
1643
1648
endforeach ()
1644
1649
endif ()
0 commit comments