File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -809,6 +809,13 @@ message(STATUS "Building Swift runtime with:")
809809message (STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER} " )
810810message (STATUS "" )
811811
812+ #
813+ # Find required dependencies.
814+ #
815+ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND "${SWIFT_PATH_TO_LIBICU_BUILD} " STREQUAL "" )
816+ find_package (ICU REQUIRED COMPONENTS uc i18n)
817+ endif ()
818+
812819#
813820# Find optional dependencies.
814821#
Original file line number Diff line number Diff line change @@ -12,14 +12,20 @@ foreach(MODULE ${ICU_FIND_COMPONENTS})
1212 ICU_${MODULE} _INCLUDE_DIR ICU_${MODULE} _LIBRARIES)
1313
1414 pkg_check_modules(PC_ICU_${MODULE} QUIET icu-${module} )
15- if (${PC_ICU_${MODULE} _FOUND})
15+ if (NOT ${PKGCONFIG_FOUND} )
16+ # PkgConfig doesn't exist on this system, so we manually provide hints via CMake.
17+ set (PC_ICU_${MODULE} _INCLUDE_DIRS "${ICU_${MODULE} _INCLUDE_DIRS}" )
18+ set (PC_ICU_${MODULE} _LIBRARY_DIRS "${ICU_${MODULE} _LIBRARY_DIRS}" )
19+ endif ()
20+
21+ if ((${PC_ICU_${MODULE} _FOUND}) OR (NOT ${PKGCONFIG_FOUND} ))
1622 set (ICU_${MODULE} _DEFINITIONS ${PC_ICU_${MODULE} _CFLAGS_OTHER})
1723
1824 find_path (ICU_${MODULE} _INCLUDE_DIR unicode
1925 HINTS ${PC_ICU_${MODULE} _INCLUDEDIR} ${PC_ICU_${MODULE} _INCLUDE_DIRS})
2026 set (ICU_${MODULE} _INCLUDE_DIRS ${ICU_${MODULE} _INCLUDE_DIR})
2127
22- find_library (ICU_${MODULE} _LIBRARY NAMES icu${module}
28+ find_library (ICU_${MODULE} _LIBRARY NAMES icu${module} ${ICU_ ${MODULE} _LIB_NAME}
2329 HINTS ${PC_ICU_${MODULE} _LIBDIR} ${PC_ICU_${MODULE} _LIBRARY_DIRS})
2430 set (ICU_${MODULE} _LIBRARIES ${ICU_${MODULE} _LIBRARY})
2531 endif ()
Original file line number Diff line number Diff line change @@ -178,7 +178,6 @@ else()
178178 #set(LINK_FLAGS
179179 # -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
180180 if ("${SWIFT_PATH_TO_LIBICU_BUILD} " STREQUAL "" )
181- find_package (ICU REQUIRED COMPONENTS uc i18n)
182181 list (APPEND swift_core_private_link_libraries
183182 ICU_UC ICU_I18N)
184183 else ()
You can’t perform that action at this time.
0 commit comments