@@ -34,11 +34,9 @@ add_custom_command(
3434 OUTPUT "${output_dir} "
3535 COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${output_dir} " )
3636
37- if (SWIFT_BUILD_STATIC_STDLIB)
38- add_custom_command (
39- OUTPUT "${output_dir_static} "
40- COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${output_dir_static} " )
41- endif ()
37+ add_custom_command (
38+ OUTPUT "${output_dir_static} "
39+ COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${output_dir_static} " )
4240
4341set (outputs)
4442foreach (input ${sources} )
@@ -52,17 +50,15 @@ foreach(input ${sources})
5250 COMMENT "Copying ${input} to ${output_dir} " )
5351 list (APPEND outputs "${output_dir} /${input} " )
5452
55- if (SWIFT_BUILD_STATIC_STDLIB)
56- add_custom_command (
57- OUTPUT "${output_dir_static} /${input} "
58- DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
59- COMMAND
60- "${CMAKE_COMMAND} " "-E" "copy_if_different"
61- "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
62- "${output_dir_static} /${input} "
63- COMMENT "Copying ${input} to ${output_dir_static} " )
64- list (APPEND outputs "${output_dir_static} /${input} " )
65- endif ()
53+ add_custom_command (
54+ OUTPUT "${output_dir_static} /${input} "
55+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
56+ COMMAND
57+ "${CMAKE_COMMAND} " "-E" "copy_if_different"
58+ "${CMAKE_CURRENT_SOURCE_DIR} /${input} "
59+ "${output_dir_static} /${input} "
60+ COMMENT "Copying ${input} to ${output_dir_static} " )
61+ list (APPEND outputs "${output_dir_static} /${input} " )
6662endforeach ()
6763if (SWIFT_STDLIB_INSTALL_PARENT_MODULE_FOR_SHIMS)
6864 # Copy the module map into the parent directory. Using "parent.modulemap"
@@ -143,21 +139,19 @@ add_custom_command_target(unused_var
143139
144140add_dependencies (copy_shim_headers symlink_clang_headers)
145141
146- if (SWIFT_BUILD_STATIC_STDLIB)
147- add_custom_command_target(unused_var
148- COMMAND
149- "${CMAKE_COMMAND} " "-E" "make_directory" "${SWIFTSTATICLIB_DIR} "
150- COMMAND
151- "${CMAKE_COMMAND} " "-E" "${SWIFT_COPY_OR_SYMLINK_DIR} "
152- "${clang_headers_location} "
153- "${SWIFTSTATICLIB_DIR} /clang"
142+ add_custom_command_target(unused_var
143+ COMMAND
144+ "${CMAKE_COMMAND} " "-E" "make_directory" "${SWIFTSTATICLIB_DIR} "
145+ COMMAND
146+ "${CMAKE_COMMAND} " "-E" "${SWIFT_COPY_OR_SYMLINK_DIR} "
147+ "${clang_headers_location} "
148+ "${SWIFTSTATICLIB_DIR} /clang"
154149
155- CUSTOM_TARGET_NAME "symlink_clang_headers_static"
156- OUTPUT "${SWIFTSTATICLIB_DIR} /clang"
157- COMMENT "Symlinking Clang resource headers into ${SWIFTSTATICLIB_DIR} /clang" )
150+ CUSTOM_TARGET_NAME "symlink_clang_headers_static"
151+ OUTPUT "${SWIFTSTATICLIB_DIR} /clang"
152+ COMMENT "Symlinking Clang resource headers into ${SWIFTSTATICLIB_DIR} /clang" )
158153
159- add_dependencies (copy_shim_headers symlink_clang_headers_static)
160- endif ()
154+ add_dependencies (copy_shim_headers symlink_clang_headers_static)
161155
162156if (NOT SWIFT_BUILT_STANDALONE)
163157 if (TARGET clang-resource -headers) # LLVM > 8
@@ -227,15 +221,15 @@ if (SWIFT_STDLIB_INSTALL_PARENT_MODULE_FOR_SHIMS)
227221 COMPONENT stdlib)
228222endif ()
229223
230- if (SWIFT_BUILD_STATIC_STDLIB)
231- swift_install_in_component(FILES ${sources}
232- DESTINATION "lib/swift_static/shims"
224+ if (SWIFT_BUILD_STATIC_STDLIB)
225+ swift_install_in_component(FILES ${sources}
226+ DESTINATION "lib/swift_static/shims"
227+ COMPONENT stdlib)
228+ if (SWIFT_STDLIB_INSTALL_PARENT_MODULE_FOR_SHIMS)
229+ swift_install_in_component(FILES "${output_dir_static} /../module.modulemap"
230+ DESTINATION "lib/swift_static"
233231 COMPONENT stdlib)
234- if (SWIFT_STDLIB_INSTALL_PARENT_MODULE_FOR_SHIMS)
235- swift_install_in_component(FILES "${output_dir_static} /../module.modulemap"
236- DESTINATION "lib/swift_static"
237- COMPONENT stdlib)
238- endif ()
232+ endif ()
239233endif ()
240234
241235# Install Clang headers under the Swift library so that an installed Swift's
@@ -245,12 +239,10 @@ swift_install_in_component(DIRECTORY "${clang_headers_location}/"
245239 COMPONENT clang-builtin-headers
246240 PATTERN "*.h" )
247241
248- if (SWIFT_BUILD_STATIC_STDLIB)
249- swift_install_in_component(DIRECTORY "${clang_headers_location} /"
250- DESTINATION "lib/swift_static/clang"
251- COMPONENT clang-builtin-headers
252- PATTERN "*.h" )
253- endif ()
242+ swift_install_in_component(DIRECTORY "${clang_headers_location} /"
243+ DESTINATION "lib/swift_static/clang"
244+ COMPONENT clang-builtin-headers
245+ PATTERN "*.h" )
254246
255247if (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER OR SWIFT_PREBUILT_CLANG)
256248 # This will still link against the Swift-forked clang headers if the Swift
@@ -268,12 +260,10 @@ swift_install_symlink_component(clang-resource-dir-symlink
268260 TARGET ${SWIFT_CLANG_RESOURCE_DIR_SYMLINK_INSTALL_TARGET}
269261 DESTINATION "lib/swift" )
270262
271- if (SWIFT_BUILD_STATIC_STDLIB)
272- swift_install_symlink_component(clang-resource -dir-symlink
273- LINK_NAME clang
274- TARGET ${SWIFT_CLANG_RESOURCE_DIR_SYMLINK_INSTALL_TARGET}
275- DESTINATION "lib/swift_static" )
276- endif ()
263+ swift_install_symlink_component(clang-resource -dir-symlink
264+ LINK_NAME clang
265+ TARGET ${SWIFT_CLANG_RESOURCE_DIR_SYMLINK_INSTALL_TARGET}
266+ DESTINATION "lib/swift_static" )
277267
278268# Possibly install Clang headers under Clang's resource directory in case we
279269# need to use a different version of the headers than the installed Clang. This
0 commit comments