@@ -80,43 +80,34 @@ set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
80
80
list (APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS )
81
81
list (APPEND swift_runtime_library_compile_flags -I${SWIFT_SOURCE_DIR}/include )
82
82
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 )
86
84
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 ()
88
91
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 ()
113
110
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 )
120
111
endif ()
121
112
122
113
add_swift_library (swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
0 commit comments