Skip to content

[build] remove special placeholder libraries #21707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1861,24 +1861,7 @@ function(add_swift_target_library name)
endif()

foreach(lib ${SWIFTLIB_PRIVATE_LINK_LIBRARIES})
if("${lib}" STREQUAL "ICU_UC")
list(APPEND swiftlib_private_link_libraries_targets
"${SWIFT_${sdk}_${arch}_ICU_UC}")
# temporary fix for atomic needing to be
# after object files for libswiftCore.so
if("${sdk}" STREQUAL "ANDROID")
list(APPEND swiftlib_private_link_libraries_targets
"-latomic")
# the same issue on FreeBSD, missing symbols:
# __atomic_store, __atomic_compare_exchange, __atomic_load
elseif("${sdk}" STREQUAL "FREEBSD")
list(APPEND swiftlib_private_link_libraries_targets
"${SWIFTLIB_DIR}/clang/lib/freebsd/libclang_rt.builtins-${arch}.a")
endif()
elseif("${lib}" STREQUAL "ICU_I18N")
list(APPEND swiftlib_private_link_libraries_targets
"${SWIFT_${sdk}_${arch}_ICU_I18N}")
elseif(TARGET "${lib}${VARIANT_SUFFIX}")
if(TARGET "${lib}${VARIANT_SUFFIX}")
list(APPEND swiftlib_private_link_libraries_targets
"${lib}${VARIANT_SUFFIX}")
else()
Expand Down
34 changes: 17 additions & 17 deletions stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,21 +238,33 @@ else()
#set(LINK_FLAGS
# -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
if("${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "")
list(APPEND swift_core_private_link_libraries ICU_UC ICU_I18N)
list(APPEND swift_core_private_link_libraries
${SWIFT_${SWIFT_PRIMARY_VARIANT_SDK}_${SWIFT_PRIMARY_VARIANT_ARCH}_ICU_UC}
${SWIFT_${SWIFT_PRIMARY_VARIANT_SDK}_${SWIFT_PRIMARY_VARIANT_ARCH}_ICU_I18N})
else()
list(APPEND swift_core_private_link_libraries -licui18nswift -licuucswift -licudataswift)
endif()
endif()

if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
if(SWIFT_PRIMARY_VARIANT_SDK STREQUAL ANDROID)
# workaround for libatomic needing to be after object files for swiftCore.so
list(APPEND swift_core_private_link_libraries atomic)
elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL CYGWIN)
# TODO(compnerd) cache this variable to permit re-configuration
execute_process(COMMAND "cygpath" "-u" "$ENV{SYSTEMROOT}" OUTPUT_VARIABLE ENV_SYSTEMROOT)
list(APPEND swift_core_private_link_libraries "${ENV_SYSTEMROOT}/system32/psapi.dll")
endif()

if(SWIFT_PRIMARY_VARIANT_SDK STREQUAL FREEBSD)
elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL FREEBSD)
find_library(EXECINFO_LIBRARY execinfo)
list(APPEND swift_core_private_link_libraries ${EXECINFO_LIBRARY})
# workaround for libatomic needing to be after object files for swiftCore.so
list(APPEND swift_core_private_link_libraries
${SWIFTLIB_DIR}/clang/lib/freebsd/libclang_rt.builtins-${SWIFT_PRIMARY_VARIANT_ARCH}.a)
elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL LINUX)
if(SWIFT_BUILD_STATIC_STDLIB)
list(APPEND swift_core_private_link_libraries swiftImageInspectionShared)
endif()
elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL WINDOWS)
list(APPEND swift_core_private_link_libraries shell32)
endif()

option(SWIFT_CHECK_ESSENTIAL_STDLIB
Expand All @@ -275,16 +287,6 @@ if(SWIFT_CHECK_ESSENTIAL_STDLIB)
target_link_libraries(swift_stdlib_essential ${RUNTIME_DEPENDENCY})
endif()


set(shared_only_libs)
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_PRIMARY_VARIANT_SDK}" STREQUAL "LINUX")
list(APPEND swift_core_private_link_libraries swiftImageInspectionShared)
endif()

if(SWIFT_PRIMARY_VARIANT_SDK STREQUAL WINDOWS)
list(APPEND swift_core_private_link_libraries shell32)
endif()

add_swift_target_library(swiftCore
${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE
${SWIFTLIB_SOURCES}
Expand All @@ -303,8 +305,6 @@ add_swift_target_library(swiftCore
${swift_core_private_link_libraries}
INCORPORATE_OBJECT_LIBRARIES
swiftRuntime swiftStdlibStubs
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
${shared_only_libs}
FRAMEWORK_DEPENDS
${swift_core_framework_depends}
INSTALL_IN_COMPONENT
Expand Down