File tree Expand file tree Collapse file tree 3 files changed +46
-42
lines changed Expand file tree Collapse file tree 3 files changed +46
-42
lines changed Original file line number Diff line number Diff line change @@ -113,48 +113,6 @@ if(SWIFT_STDLIB_ENABLE_SIB_TARGETS)
113
113
endif ()
114
114
swift_create_stdlib_targets ("swift-test-stdlib" "" FALSE )
115
115
116
- foreach (sdk ${SWIFT_SDKS} )
117
- foreach (arch ${SWIFT_SDK_${sdk}_ARCHITECTURES} )
118
- set (platform "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" )
119
- set (input "${SWIFT_SOURCE_DIR} /stdlib/public/legacy_layouts/${platform} /layouts-${arch} .yaml" )
120
- set (output "${SWIFTLIB_DIR} /${platform} /layouts-${arch} .yaml" )
121
-
122
- if (EXISTS "${input} " )
123
- # Copy the input file to the build directory.
124
- add_custom_command (
125
- OUTPUT "${output} "
126
- DEPENDS "${input} "
127
- COMMAND
128
- "${CMAKE_COMMAND} " -E copy
129
- "${input} "
130
- "${output} " )
131
-
132
- # Define a target for this so that we can depend on it when
133
- # building Swift sources.
134
- add_custom_target (
135
- "copy-legacy-layouts-${platform} -${arch} "
136
- DEPENDS "${output} "
137
- SOURCES "${input} " )
138
-
139
- # Make sure we ultimately always do this as part of building the
140
- # standard library. In practice we'll do this earlier if at least
141
- # one Swift source file has changed.
142
- add_dependencies (
143
- "swift-stdlib-${platform} -${arch} "
144
- "copy-legacy-layouts-${platform} -${arch} " )
145
-
146
- swift_install_in_component (compiler
147
- FILES ${input}
148
- DESTINATION "lib/swift/${platform} /" )
149
- else ()
150
- # Add a dummy target that does nothing so we can still depend on it
151
- # later without checking if the input files exist.
152
- add_custom_target (
153
- "copy-legacy-layouts-${platform} -${arch} " )
154
- endif ()
155
- endforeach ()
156
- endforeach ()
157
-
158
116
add_subdirectory (public )
159
117
add_subdirectory (private )
160
118
add_subdirectory (tools )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ if(CXX_SUPPORTS_DEFAULT_HIDDEN_VISIBILITY)
52
52
list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-fvisibility=hidden" )
53
53
endif ()
54
54
55
+ add_subdirectory (legacy_layouts )
55
56
add_subdirectory (SwiftShims )
56
57
57
58
if (SWIFT_BUILD_STDLIB )
Original file line number Diff line number Diff line change
1
+ add_custom_target ("copy-legacy-layouts" ALL )
2
+
3
+ foreach (sdk ${SWIFT_SDKS} )
4
+ foreach (arch ${SWIFT_SDK_${sdk}_ARCHITECTURES} )
5
+ set (platform "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" )
6
+
7
+ set (input "${SWIFT_SOURCE_DIR} /stdlib/public/legacy_layouts/${platform} /layouts-${arch} .yaml" )
8
+ set (output "${SWIFTLIB_DIR} /${platform} /layouts-${arch} .yaml" )
9
+
10
+ set (copy_target "copy-legacy-layouts-${platform} -${arch} " )
11
+ set (stdlib_target "swift-stdlib-${platform} -${arch} " )
12
+
13
+ if (EXISTS "${input} " )
14
+ # Copy the input file to the build directory.
15
+ add_custom_command (
16
+ OUTPUT "${output} "
17
+ DEPENDS "${input} "
18
+ COMMAND "${CMAKE_COMMAND} " -E copy "${input} " "${output} " )
19
+
20
+ # Define a target for this so that we can depend on it when
21
+ # building Swift sources.
22
+ add_custom_target (
23
+ "${copy_target} "
24
+ DEPENDS "${output} "
25
+ SOURCES "${input} " )
26
+
27
+ # Make sure we ultimately always do this as part of building the
28
+ # standard library. In practice we'll do this earlier if at least
29
+ # one Swift source file has changed.
30
+ if (TARGET "${stdlib_target} " )
31
+ add_dependencies ("${stdlib_target} " "${copy_target} " )
32
+ endif ()
33
+
34
+ swift_install_in_component (compiler
35
+ FILES "${input} "
36
+ DESTINATION "lib/swift/${platform} /" )
37
+ else ()
38
+ # Add a dummy target that does nothing so we can still depend on it
39
+ # later without checking if the input files exist.
40
+ add_custom_target ("${copy_target} " )
41
+ endif ()
42
+
43
+ add_dependencies ("copy-legacy-layouts" "${copy_target} " )
44
+ endforeach ()
45
+ endforeach ()
You can’t perform that action at this time.
0 commit comments