Skip to content

[stdlib] Drop ICU #40340

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 3 commits into from
Dec 7, 2021
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
31 changes: 0 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1018,37 +1018,6 @@ endif()
# Find required dependencies.
#

function(swift_icu_variables_set sdk arch result)
string(TOUPPER "${sdk}" sdk)

set(icu_var_ICU_UC_INCLUDE ${SWIFT_${sdk}_${arch}_ICU_UC_INCLUDE})
set(icu_var_ICU_UC ${SWIFT_${sdk}_${arch}_ICU_UC})
set(icu_var_ICU_I18N_INCLUDE ${SWIFT_${sdk}_${arch}_ICU_I18N_INCLUDE})
set(icu_var_ICU_I18N ${SWIFT_${sdk}_${arch}_ICU_I18N})

if(icu_var_ICU_UC_INCLUDE AND icu_var_ICU_UC AND
icu_var_ICU_I18N_INCLUDE AND icu_var_ICU_I18N)
set(${result} TRUE PARENT_SCOPE)
else()
set(${result} FALSE PARENT_SCOPE)
endif()
endfunction()

# ICU is provided through CoreFoundation on Darwin. On other hosts, if the ICU
# unicode and i18n include and library paths are not defined, perform a standard
# package lookup. Otherwise, rely on the paths specified by the user. These
# need to be defined when cross-compiling.
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
swift_icu_variables_set("${SWIFT_PRIMARY_VARIANT_SDK}"
"${SWIFT_PRIMARY_VARIANT_ARCH}"
ICU_CONFIGURED)
if("${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "" AND NOT ${ICU_CONFIGURED})
find_package(ICU REQUIRED COMPONENTS uc i18n)
endif()
endif()
endif()

find_package(Python3 COMPONENTS Interpreter REQUIRED)

#
Expand Down
40 changes: 0 additions & 40 deletions cmake/modules/FindICU.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ function(_report_sdk prefix)
message(STATUS " ${arch} libc header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}")
message(STATUS " ${arch} libc architecture specific header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY}")
endforeach()
if(SWIFT_BUILD_STDLIB)
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
message(STATUS " ${arch} ICU i18n INCLUDE: ${SWIFT_${prefix}_${arch}_ICU_I18N_INCLUDE}")
message(STATUS " ${arch} ICU i18n LIB: ${SWIFT_${prefix}_${arch}_ICU_I18N}")
message(STATUS " ${arch} ICU unicode INCLUDE: ${SWIFT_${prefix}_${arch}_ICU_UC_INCLUDE}")
message(STATUS " ${arch} ICU unicode LIB: ${SWIFT_${prefix}_${arch}_ICU_UC}")
endforeach()
endif()
endif()

message(STATUS "")
Expand Down
19 changes: 0 additions & 19 deletions stdlib/cmake/modules/AddSwiftStdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,6 @@ function(_add_target_variant_link_flags)
# link against the custom C++ library
swift_android_cxx_libraries_for_arch(${LFLAGS_ARCH} cxx_link_libraries)
list(APPEND link_libraries ${cxx_link_libraries})

# link against the ICU libraries
list(APPEND link_libraries
${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_I18N}
${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_UC})
else()
# If lto is enabled, we need to add the object path flag so that the LTO code
# generator leaves the intermediate object file in a place where it will not
Expand All @@ -461,17 +456,6 @@ function(_add_target_variant_link_flags)
endif()
endif()

if(NOT "${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_UC}" STREQUAL "")
get_filename_component(SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_UC_LIBDIR
"${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_UC}" DIRECTORY)
list(APPEND library_search_directories "${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_UC_LIBDIR}")
endif()
if(NOT "${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_I18N}" STREQUAL "")
get_filename_component(SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_I18N_LIBDIR
"${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_I18N}" DIRECTORY)
list(APPEND library_search_directories "${SWIFT_${LFLAGS_SDK}_${LFLAGS_ARCH}_ICU_I18N_LIBDIR}")
endif()

if(SWIFT_USE_LINKER AND NOT SWIFT_COMPILER_IS_MSVC_LIKE)
# The linker is normally chosen based on the host, but the Android NDK only
# uses lld now.
Expand Down Expand Up @@ -1313,9 +1297,6 @@ function(add_swift_target_library_single target name)
"SHELL:-Xclang --dependent-lib=msvcrt$<$<CONFIG:Debug>:d>")
endif()
endif()
target_include_directories(${target} SYSTEM PRIVATE
${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}
${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
target_compile_options(${target} PRIVATE
${c_compile_flags})
target_link_options(${target} PRIVATE
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/SwiftShims/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ set(sources
Target.h
ThreadLocalStorage.h
UnicodeData.h
UnicodeShims.h
Visibility.h
_SwiftConcurrency.h
_SwiftDistributed.h
Expand Down
Loading