File tree Expand file tree Collapse file tree 4 files changed +49
-42
lines changed Expand file tree Collapse file tree 4 files changed +49
-42
lines changed Original file line number Diff line number Diff line change @@ -1078,6 +1078,8 @@ endif()
1078
1078
if (SWIFT_BUILD_STDLIB )
1079
1079
add_subdirectory (stdlib )
1080
1080
else ()
1081
+ add_subdirectory (stdlib/public/legacy_layouts )
1082
+
1081
1083
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1082
1084
# ensure we build that when building tools.
1083
1085
if (SWIFT_INCLUDE_TOOLS )
Original file line number Diff line number Diff line change @@ -128,48 +128,6 @@ if(SWIFT_STDLIB_ENABLE_SIB_TARGETS)
128
128
endif ()
129
129
swift_create_stdlib_targets ("swift-test-stdlib" "" FALSE )
130
130
131
- foreach (sdk ${SWIFT_SDKS} )
132
- foreach (arch ${SWIFT_SDK_${sdk}_ARCHITECTURES} )
133
- set (platform "${SWIFT_SDK_${sdk} _LIB_SUBDIR}" )
134
- set (input "${SWIFT_SOURCE_DIR} /stdlib/public/legacy_layouts/${platform} /layouts-${arch} .yaml" )
135
- set (output "${SWIFTLIB_DIR} /${platform} /layouts-${arch} .yaml" )
136
-
137
- if (EXISTS "${input} " )
138
- # Copy the input file to the build directory.
139
- add_custom_command (
140
- OUTPUT "${output} "
141
- DEPENDS "${input} "
142
- COMMAND
143
- "${CMAKE_COMMAND} " -E copy
144
- "${input} "
145
- "${output} " )
146
-
147
- # Define a target for this so that we can depend on it when
148
- # building Swift sources.
149
- add_custom_target (
150
- "copy-legacy-layouts-${platform} -${arch} "
151
- DEPENDS "${output} "
152
- SOURCES "${input} " )
153
-
154
- # Make sure we ultimately always do this as part of building the
155
- # standard library. In practice we'll do this earlier if at least
156
- # one Swift source file has changed.
157
- add_dependencies (
158
- "swift-stdlib-${platform} -${arch} "
159
- "copy-legacy-layouts-${platform} -${arch} " )
160
-
161
- swift_install_in_component (FILES ${input}
162
- DESTINATION "lib/swift/${platform} /"
163
- COMPONENT compiler )
164
- else ()
165
- # Add a dummy target that does nothing so we can still depend on it
166
- # later without checking if the input files exist.
167
- add_custom_target (
168
- "copy-legacy-layouts-${platform} -${arch} " )
169
- endif ()
170
- endforeach ()
171
- endforeach ()
172
-
173
131
add_subdirectory (public )
174
132
add_subdirectory (private )
175
133
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 (
35
+ FILES "${input} "
36
+ DESTINATION "lib/swift/${platform} /"
37
+ COMPONENT compiler )
38
+ else ()
39
+ # Add a dummy target that does nothing so we can still depend on it
40
+ # later without checking if the input files exist.
41
+ add_custom_target ("${copy_target} " )
42
+ endif ()
43
+
44
+ add_dependencies ("copy-legacy-layouts" "${copy_target} " )
45
+ endforeach ()
46
+ endforeach ()
You can’t perform that action at this time.
0 commit comments