File tree Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change 1
1
2
2
include (AddSwift )
3
3
include (SwiftSource )
4
+ include (CompatibilityLibs )
4
5
5
6
function (add_dependencies_multiple_targets )
6
7
cmake_parse_arguments (
@@ -2798,6 +2799,15 @@ function(_add_swift_target_executable_single name)
2798
2799
${SWIFTEXE_SINGLE_SOURCES}
2799
2800
${SWIFTEXE_SINGLE_EXTERNAL_SOURCES} )
2800
2801
2802
+ # Darwin may need the compatibility libraries
2803
+ set (compatibility_libs )
2804
+ if (SWIFTEXE_SINGLE_SDK IN_LIST SWIFT_DARWIN_PLATFORMS )
2805
+ get_compatibility_libs (
2806
+ "${SWIFTEXE_SINGLE_SDK} "
2807
+ "${SWIFTEXE_SINGLE_ARCHITECTURE} "
2808
+ compatibility_libs )
2809
+ endif ()
2810
+
2801
2811
# ELF and COFF need swiftrt
2802
2812
if (("${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "ELF" OR
2803
2813
"${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "COFF" )
@@ -2811,6 +2821,7 @@ function(_add_swift_target_executable_single name)
2811
2821
TARGETS "${name} "
2812
2822
DEPENDS
2813
2823
${dependency_target}
2824
+ ${compatibility_libs}
2814
2825
${LLVM_COMMON_DEPENDS}
2815
2826
${SWIFTEXE_SINGLE_DEPENDS} )
2816
2827
llvm_update_compile_flags ("${name} " )
Original file line number Diff line number Diff line change
1
+ # Generate a list of the compatibility library targets given an sdk and
2
+ # architecture.
3
+ function (get_compatibility_libs sdk arch result_var_name )
4
+ set (compatibility_libs )
5
+
6
+ if (SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT )
7
+ set (vsuffix "-${SWIFT_SDK_${sdk} _LIB_SUBDIR}-${arch} " )
8
+
9
+ list (APPEND compatibility_libs
10
+ swiftCompatibilityConcurrency${vsuffix}
11
+ swiftCompatibilityDynamicReplacements${vsuffix}
12
+ swiftCompatibilityPacks${vsuffix}
13
+ swiftCompatibility50${vsuffix}
14
+ swiftCompatibility51${vsuffix}
15
+ swiftCompatibility56${vsuffix} )
16
+ endif ()
17
+
18
+ set ("${result_var_name} " "${compatibility_libs} " PARENT_SCOPE )
19
+ endfunction ()
Original file line number Diff line number Diff line change 3
3
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /../cmake/modules )
4
4
include (StdlibOptions )
5
5
include (AddSwiftStdlib )
6
+ include (CompatibilityLibs )
6
7
7
8
set (CXX_COMPILE_FLAGS )
8
9
set (CXX_LINK_FLAGS )
@@ -58,13 +59,13 @@ if(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
58
59
# of all the compatibility libraries needed to build
59
60
# host tools in a single place
60
61
add_library (HostCompatibilityLibs INTERFACE )
61
- set (vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK} _LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH} " )
62
+ get_compatibility_libs (
63
+ "${SWIFT_HOST_VARIANT_SDK} "
64
+ "${SWIFT_HOST_VARIANT_ARCH} "
65
+ compatibility_libs
66
+ )
62
67
target_link_libraries (HostCompatibilityLibs INTERFACE
63
- swiftCompatibilityConcurrency${vsuffix}
64
- swiftCompatibilityDynamicReplacements${vsuffix}
65
- swiftCompatibilityPacks${vsuffix}
66
- swiftCompatibility50${vsuffix}
67
- swiftCompatibility51${vsuffix}
68
- swiftCompatibility56${vsuffix} )
68
+ ${compatibility_libs}
69
+ )
69
70
set_property (GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS HostCompatibilityLibs )
70
71
endif ()
You can’t perform that action at this time.
0 commit comments