@@ -81,59 +81,11 @@ set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
8181list (APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)
8282list (APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR} /stdlib/include /llvm/Support -I${SWIFT_SOURCE_DIR} /include )
8383
84- set (static_binary_lnk_file_list)
85- set (static_binary_dependencies_list)
8684macro (add_image_inspection_shared sdk primary_arch inspection_file linkfile_src)
87- if (${inspection_file} IN_LIST swift_runtime_sources)
88- list (REMOVE_ITEM swift_runtime_sources ${inspection_file} )
89- endif ()
85+ set (static_binary_lnk_file_list)
9086 string (TOLOWER "${sdk} " lowercase_sdk)
9187
92- # These two libraries are only used with the static swiftcore
93- add_swift_target_library(swiftImageInspectionShared STATIC
94- ${inspection_file}
95- C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
96- LINK_FLAGS ${swift_runtime_linker_flags}
97- SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
98- TARGET_SDKS ${sdk}
99- INSTALL_IN_COMPONENT stdlib)
100-
101- foreach (arch IN LISTS SWIFT_SDK_${sdk} _ARCHITECTURES)
102- set (FragileSupportLibrary swiftImageInspectionShared-${SWIFT_SDK_${sdk} _LIB_SUBDIR}-${arch} )
103- set (LibraryLocation ${SWIFTSTATICLIB_DIR} /${lowercase_sdk} /${arch} )
104-
105- add_custom_command_target(swift_image_inspection_${lowercase_sdk} _${arch} _static
106- COMMAND
107- "${CMAKE_COMMAND} " -E copy $<TARGET_FILE:${FragileSupportLibrary} > ${LibraryLocation}
108- OUTPUT
109- "${LibraryLocation} /${CMAKE_STATIC_LIBRARY_PREFIX} swiftImageInspectionShared${CMAKE_STATIC_LIBRARY_SUFFIX} "
110- DEPENDS
111- ${FragileSupportLibrary} )
112-
113- list (APPEND static_binary_dependencies_list ${swift_image_inspection_${lowercase_sdk} _${arch} _static})
114- add_dependencies (stdlib ${FragileSupportLibrary} )
115- swift_install_in_component(FILES $<TARGET_FILE:${FragileSupportLibrary} >
116- DESTINATION "lib/swift_static/${lowercase_sdk} /${arch} "
117- COMPONENT stdlib)
118- endforeach ()
119-
120- if (NOT "${primary_arch} " STREQUAL "" )
121- set (FragileSupportLibraryPrimary swiftImageInspectionShared-${SWIFT_SDK_${sdk} _LIB_SUBDIR}-${primary_arch} )
122- set (LibraryLocationPrimary ${SWIFTSTATICLIB_DIR} /${lowercase_sdk} )
123- add_custom_command_target(swift_image_inspection_static_${lowercase_sdk} _primary_arch
124- COMMAND
125- "${CMAKE_COMMAND} " -E copy $<TARGET_FILE:${FragileSupportLibraryPrimary} > ${LibraryLocationPrimary}
126- OUTPUT
127- "${LibraryLocationPrimary} /${CMAKE_STATIC_LIBRARY_PREFIX} swiftImageInspectionShared${CMAKE_STATIC_LIBRARY_SUFFIX} "
128- DEPENDS
129- ${FragileSupportLibraryPrimary} )
130- list (APPEND static_binary_dependencies_list ${swift_image_inspection_static_${lowercase_sdk} _primary_arch})
131- add_dependencies (stdlib ${FragileSupportLibraryPrimary} )
132- swift_install_in_component(FILES $<TARGET_FILE:${FragileSupportLibraryPrimary} >
133- DESTINATION "lib/swift_static/${lowercase_sdk} "
134- COMPONENT stdlib)
135- endif ()
136-
88+ # Generate the static-executable-args.lnk file used for ELF systems (eg linux)
13789 set (linkfile "${lowercase_sdk} /static-executable-args.lnk" )
13890 add_custom_command_target(swift_static_binary_${sdk} _args
13991 COMMAND
@@ -149,14 +101,6 @@ macro(add_image_inspection_shared sdk primary_arch inspection_file linkfile_src)
149101 swift_install_in_component(FILES "${SWIFTSTATICLIB_DIR} /${linkfile} "
150102 DESTINATION "lib/swift_static/${lowercase_sdk} "
151103 COMPONENT stdlib)
152-
153- add_swift_target_library(swiftImageInspectionSharedObject OBJECT_LIBRARY
154- ${inspection_file}
155- C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
156- LINK_FLAGS ${swift_runtime_linker_flags}
157- SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
158- TARGET_SDKS ${sdk}
159- INSTALL_IN_COMPONENT never_install)
160104endmacro ()
161105
162106set (is_image_inspection_required)
@@ -194,7 +138,7 @@ foreach(sdk IN LISTS SWIFT_SDKS)
194138endforeach ()
195139
196140if (is_image_inspection_required)
197- add_custom_target (static_binary_magic ALL DEPENDS ${static_binary_lnk_file_list} ${static_binary_dependencies_list} )
141+ add_custom_target (static_binary_magic ALL DEPENDS ${static_binary_lnk_file_list} )
198142 add_dependencies (stdlib static_binary_magic)
199143endif ()
200144
@@ -338,7 +282,6 @@ foreach(sdk ${SWIFT_CONFIGURED_SDKS})
338282-ldl
339283-lpthread
340284-lswiftCore
341- -lswiftImageInspectionShared
342285${libicu_i18n_a}
343286${libicu_uc_a}
344287${libicu_data_a}
@@ -358,7 +301,6 @@ ${libicu_data_a}
358301-latomic
359302-lswiftWasiPthread
360303-lswiftCore
361- -lswiftImageInspectionShared
362304-licuuc
363305-licudata
364306-lstdc++
0 commit comments