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:")
809
809
message (STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER} " )
810
810
message (STATUS "" )
811
811
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
+
812
819
#
813
820
# Find optional dependencies.
814
821
#
Original file line number Diff line number Diff line change @@ -12,14 +12,20 @@ foreach(MODULE ${ICU_FIND_COMPONENTS})
12
12
ICU_${MODULE}_INCLUDE_DIR ICU_${MODULE}_LIBRARIES )
13
13
14
14
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} ))
16
22
set (ICU_${MODULE}_DEFINITIONS ${PC_ICU_${MODULE}_CFLAGS_OTHER} )
17
23
18
24
find_path (ICU_${MODULE}_INCLUDE_DIR unicode
19
25
HINTS ${PC_ICU_${MODULE}_INCLUDEDIR} ${PC_ICU_${MODULE}_INCLUDE_DIRS} )
20
26
set (ICU_${MODULE}_INCLUDE_DIRS ${ICU_${MODULE}_INCLUDE_DIR} )
21
27
22
- find_library (ICU_${MODULE}_LIBRARY NAMES icu${module}
28
+ find_library (ICU_${MODULE}_LIBRARY NAMES icu${module} ${ICU_${MODULE}_LIB_NAME}
23
29
HINTS ${PC_ICU_${MODULE}_LIBDIR} ${PC_ICU_${MODULE}_LIBRARY_DIRS} )
24
30
set (ICU_${MODULE}_LIBRARIES ${ICU_${MODULE}_LIBRARY} )
25
31
endif ()
Original file line number Diff line number Diff line change @@ -178,7 +178,6 @@ else()
178
178
#set(LINK_FLAGS
179
179
# -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
180
180
if ("${SWIFT_PATH_TO_LIBICU_BUILD} " STREQUAL "" )
181
- find_package (ICU REQUIRED COMPONENTS uc i18n )
182
181
list (APPEND swift_core_private_link_libraries
183
182
ICU_UC ICU_I18N )
184
183
else ()
You can’t perform that action at this time.
0 commit comments