Skip to content

Commit 056a367

Browse files
committed
remove concept of swiftImageInspectionStatic/Shared libraries
1 parent 807798e commit 056a367

File tree

5 files changed

+25
-48
lines changed

5 files changed

+25
-48
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,6 @@ if(SWIFT_CHECK_ESSENTIAL_STDLIB)
238238
endif()
239239

240240

241-
set(shared_only_libs)
242-
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
243-
list(APPEND shared_only_libs swiftImageInspectionShared)
244-
endif()
245-
246241
add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE
247242
${SWIFTLIB_SOURCES}
248243
# The copy_shim_headers target dependency is required to let the
@@ -257,6 +252,5 @@ add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STD
257252
LINK_FLAGS ${swift_core_link_flags}
258253
PRIVATE_LINK_LIBRARIES ${swift_core_private_link_libraries}
259254
INCORPORATE_OBJECT_LIBRARIES swiftRuntime swiftStdlibStubs
260-
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY ${shared_only_libs}
261255
FRAMEWORK_DEPENDS ${swift_core_framework_depends}
262256
INSTALL_IN_COMPONENT stdlib)

stdlib/public/runtime/CMakeLists.txt

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,43 +80,34 @@ set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
8080
list(APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)
8181
list(APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR}/include)
8282

83-
set(sdk "${SWIFT_HOST_VARIANT_SDK}")
84-
if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
85-
list(REMOVE_ITEM swift_runtime_sources ImageInspectionELF.cpp)
83+
if(SWIFT_BUILD_STATIC_STDLIB)
8684
set(static_binary_lnk_file_list)
87-
string(TOLOWER "${sdk}" lowercase_sdk)
85+
foreach(sdk ${SWIFT_SDKS})
86+
if(NOT "${sdk}" STREQUAL "LINUX" AND
87+
NOT "${sdk}" STREQUAL "FREEBSD" AND
88+
NOT "${sdk}" STREQUAL "ANDROID")
89+
continue()
90+
endif()
8891

89-
# These two libraries are only used with the static swiftcore
90-
add_swift_library(swiftImageInspectionShared STATIC
91-
ImageInspectionELF.cpp
92-
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
93-
LINK_FLAGS ${swift_runtime_linker_flags})
94-
set_target_properties(swiftImageInspectionShared PROPERTIES
95-
ARCHIVE_OUTPUT_DIRECTORY "${SWIFTSTATICLIB_DIR}/${lowercase_sdk}")
96-
97-
# Generate the static-executable-args.lnk file used for ELF systems (eg linux)
98-
set(linkfile "${lowercase_sdk}/static-executable-args.lnk")
99-
add_custom_command_target(swift_static_binary_${sdk}_args
100-
COMMAND
101-
"${CMAKE_COMMAND}" -E copy
102-
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk"
103-
"${SWIFTSTATICLIB_DIR}/${linkfile}"
104-
OUTPUT
105-
"${SWIFTSTATICLIB_DIR}/${linkfile}"
106-
DEPENDS
107-
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk")
108-
109-
list(APPEND static_binary_lnk_file_list ${swift_static_binary_${sdk}_args})
110-
swift_install_in_component(stdlib
111-
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
112-
DESTINATION "lib/swift_static/${lowercase_sdk}")
92+
string(TOLOWER "${sdk}" lowercase_sdk)
93+
# Generate the static-executable-args.lnk file used for ELF systems (eg linux)
94+
set(linkfile "${lowercase_sdk}/static-executable-args.lnk")
95+
add_custom_command_target(swift_static_binary_${sdk}_args
96+
COMMAND
97+
"${CMAKE_COMMAND}" -E copy
98+
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk"
99+
"${SWIFTSTATICLIB_DIR}/${linkfile}"
100+
OUTPUT
101+
"${SWIFTSTATICLIB_DIR}/${linkfile}"
102+
DEPENDS
103+
"${SWIFT_SOURCE_DIR}/utils/static-executable-args.lnk")
104+
105+
list(APPEND static_binary_lnk_file_list ${swift_static_binary_${sdk}_args})
106+
swift_install_in_component(stdlib
107+
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
108+
DESTINATION "lib/swift_static/${lowercase_sdk}")
109+
endforeach()
113110
add_custom_target(static_binary_magic ALL DEPENDS ${static_binary_lnk_file_list})
114-
115-
add_swift_library(swiftImageInspectionShared OBJECT_LIBRARY TARGET_LIBRARY
116-
ImageInspectionELF.cpp
117-
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
118-
LINK_FLAGS ${swift_runtime_linker_flags}
119-
INSTALL_IN_COMPONENT never_install)
120111
endif()
121112

122113
add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY

unittests/runtime/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
22
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))
33

4-
set(swift_runtime_test_extra_libraries)
5-
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
6-
list(APPEND swift_runtime_test_extra_libraries swiftImageInspectionShared)
7-
endif()
8-
94
add_subdirectory(LongTests)
105

116
set(PLATFORM_SOURCES)
@@ -51,7 +46,6 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
5146
target_link_libraries(SwiftRuntimeTests
5247
swiftCore${SWIFT_PRIMARY_VARIANT_SUFFIX}
5348
${PLATFORM_TARGET_LINK_LIBRARIES}
54-
${swift_runtime_test_extra_libraries}
5549
)
5650
endif()
5751

utils/gen-static-stdlib-link-args

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ function write_linkfile {
6464
-latomic
6565
-lswiftCore
6666
-latomic
67-
-lswiftImageInspectionShared
6867
$ICU_LIBS
6968
-Xlinker
7069
-export-dynamic

utils/static-executable-args.lnk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-static
22
-lswiftCore
3-
-lswiftImageInspectionStatic
43
-Xlinker
54
--defsym=__import_pthread_self=pthread_self
65
-Xlinker

0 commit comments

Comments
 (0)