@@ -237,21 +237,33 @@ else()
237
237
#set(LINK_FLAGS
238
238
# -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
239
239
if ("${SWIFT_PATH_TO_LIBICU_BUILD} " STREQUAL "" )
240
- list (APPEND swift_core_private_link_libraries ICU_UC ICU_I18N )
240
+ list (APPEND swift_core_private_link_libraries
241
+ ${SWIFT_${SWIFT_PRIMARY_VARIANT_SDK}_${SWIFT_PRIMARY_VARIANT_ARCH}_ICU_UC}
242
+ ${SWIFT_${SWIFT_PRIMARY_VARIANT_SDK}_${SWIFT_PRIMARY_VARIANT_ARCH}_ICU_I18N} )
241
243
else ()
242
244
list (APPEND swift_core_private_link_libraries -licui18nswift -licuucswift -licudataswift )
243
245
endif ()
244
246
endif ()
245
247
246
- if ("${CMAKE_SYSTEM_NAME} " STREQUAL "CYGWIN" )
248
+ if (SWIFT_PRIMARY_VARIANT_SDK STREQUAL ANDROID )
249
+ # workaround for libatomic needing to be after object files for swiftCore.so
250
+ list (APPEND swift_core_private_link_libraries atomic )
251
+ elseif (SWIFT_PRIMARY_VARIANT_SDK STREQUAL CYGWIN )
247
252
# TODO(compnerd) cache this variable to permit re-configuration
248
253
execute_process (COMMAND "cygpath" "-u" "$ENV{SYSTEMROOT} " OUTPUT_VARIABLE ENV_SYSTEMROOT )
249
254
list (APPEND swift_core_private_link_libraries "${ENV_SYSTEMROOT} /system32/psapi.dll" )
250
- endif ()
251
-
252
- if (SWIFT_PRIMARY_VARIANT_SDK STREQUAL FREEBSD )
255
+ elseif (SWIFT_PRIMARY_VARIANT_SDK STREQUAL FREEBSD )
253
256
find_library (EXECINFO_LIBRARY execinfo )
254
257
list (APPEND swift_core_private_link_libraries ${EXECINFO_LIBRARY} )
258
+ # workaround for libatomic needing to be after object files for swiftCore.so
259
+ list (APPEND swift_core_private_link_libraries
260
+ ${SWIFTLIB_DIR} /clang/lib/freebsd/libclang_rt.builtins-${SWIFT_PRIMARY_VARIANT_ARCH}.a )
261
+ elseif (SWIFT_PRIMARY_VARIANT_SDK STREQUAL LINUX )
262
+ if (SWIFT_BUILD_STATIC_STDLIB )
263
+ list (APPEND swift_core_private_link_libraries swiftImageInspectionShared )
264
+ endif ()
265
+ elseif (SWIFT_PRIMARY_VARIANT_SDK STREQUAL WINDOWS )
266
+ list (APPEND swift_core_private_link_libraries shell32 )
255
267
endif ()
256
268
257
269
option (SWIFT_CHECK_ESSENTIAL_STDLIB
@@ -274,16 +286,6 @@ if(SWIFT_CHECK_ESSENTIAL_STDLIB)
274
286
target_link_libraries (swift_stdlib_essential ${RUNTIME_DEPENDENCY} )
275
287
endif ()
276
288
277
-
278
- set (shared_only_libs )
279
- if (SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_PRIMARY_VARIANT_SDK} " STREQUAL "LINUX" )
280
- list (APPEND swift_core_private_link_libraries swiftImageInspectionShared )
281
- endif ()
282
-
283
- if (SWIFT_PRIMARY_VARIANT_SDK STREQUAL WINDOWS )
284
- list (APPEND swift_core_private_link_libraries shell32 )
285
- endif ()
286
-
287
289
add_swift_target_library (swiftCore
288
290
${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE
289
291
${SWIFTLIB_SOURCES}
@@ -302,8 +304,6 @@ add_swift_target_library(swiftCore
302
304
${swift_core_private_link_libraries}
303
305
INCORPORATE_OBJECT_LIBRARIES
304
306
swiftRuntime swiftStdlibStubs
305
- INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
306
- ${shared_only_libs}
307
307
FRAMEWORK_DEPENDS
308
308
${swift_core_framework_depends}
309
309
INSTALL_IN_COMPONENT
0 commit comments