File tree Expand file tree Collapse file tree 4 files changed +21
-12
lines changed
tools/SourceKit/cmake/modules Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -301,12 +301,13 @@ else()
301
301
endif ()
302
302
endif ()
303
303
if (SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS AND SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT )
304
- set (platform ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR} )
305
- set (compatibility_libs
306
- "swiftCompatibility50-${platform} "
307
- "swiftCompatibility51-${platform} "
308
- "swiftCompatibilityDynamicReplacements-${platform} " )
309
-
304
+ # We cannot specify directly HostCompatibilityLibs
305
+ # because ultimately is used to specify a dependency for a
306
+ # custom target and, unlike `target_link_libraries`, such dependency
307
+ # would be lost at the generation of the build system.
308
+ get_property (compatibility_libs
309
+ TARGET HostCompatibilityLibs
310
+ PROPERTY INTERFACE_LINK_LIBRARIES )
310
311
list (APPEND b0_deps ${compatibility_libs} )
311
312
list (APPEND b1_deps ${compatibility_libs} )
312
313
endif ()
Original file line number Diff line number Diff line change @@ -465,9 +465,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
465
465
# the stdlib is not picked up from there, but from the SDK.
466
466
# This requires to explicitly add all the needed compatibility libraries. We
467
467
# can take them from the current build.
468
- set(vsuffix " -${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH} ")
469
- set(conctarget " swiftCompatibilityConcurrency${vsuffix} ")
470
- target_link_libraries(${target} PUBLIC ${conctarget} )
468
+ target_link_libraries(${target} PUBLIC HostCompatibilityLibs)
471
469
472
470
# Add the SDK directory for the host platform.
473
471
target_link_directories(${target} PRIVATE " ${sdk_dir} ")
Original file line number Diff line number Diff line change @@ -53,4 +53,16 @@ if(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
53
53
add_subdirectory (CompatibilityDynamicReplacements )
54
54
add_subdirectory (CompatibilityConcurrency )
55
55
add_subdirectory (CompatibilityThreading )
56
+
57
+ # This is a convenience target to have the list
58
+ # of all the compatibility libraries needed to build
59
+ # host tools in a single place
60
+ add_library (HostCompatibilityLibs INTERFACE )
61
+ set (vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH} " )
62
+ target_link_libraries (HostCompatibilityLibs INTERFACE
63
+ swiftCompatibilityConcurrency${vsuffix}
64
+ swiftCompatibilityDynamicReplacements${vsuffix}
65
+ swiftCompatibility50${vsuffix}
66
+ swiftCompatibility51${vsuffix} )
67
+ set_property (GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS HostCompatibilityLibs )
56
68
endif ()
Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ function(add_sourcekitd_swifrt_linking target path HAS_SWIFT_MODULES)
51
51
# the stdlib is not picked up from there, but from the SDK.
52
52
# This requires to explicitly add all the needed compatibility libraries. We
53
53
# can take them from the current build.
54
- set (vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH} " )
55
- set (conctarget "swiftCompatibilityConcurrency${vsuffix} " )
56
- target_link_libraries (${target} PUBLIC ${conctarget} )
54
+ target_link_libraries (${target} PUBLIC HostCompatibilityLibs )
57
55
58
56
# Add the SDK directory for the host platform.
59
57
target_link_directories (${target} PRIVATE "${sdk_dir} " )
You can’t perform that action at this time.
0 commit comments