Skip to content

Commit 2385930

Browse files
committed
[CMake] Include ICU for stubs
`stdlib/public/stubs` includes `unicode/ustring.h`, `unicode/ucol.h`, `unicode/ucoleitr.h`, and `unicode/uiter.h`. Also, `stubs` comes before `core` in the CMake configuration order. As a result, ICU includes are not configured in time for `stubs`. This causes an error when building Swift for Android. This behavior was introduced in d227aeb. This commit reverts the include order change.
1 parent 9e8266a commit 2385930

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ else()
160160
find_package(ICU REQUIRED COMPONENTS uc i18n)
161161
list(APPEND swift_core_private_link_libraries
162162
${ICU_UC_LIBRARY} ${ICU_I18N_LIBRARY})
163-
include_directories(
164-
${ICU_UC_INCLUDE_DIR} ${ICU_I18N_INCLUDE_DIR})
165163
endif()
166164

167165
if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")

stdlib/public/stubs/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
99
set(LLVM_OPTIONAL_SOURCES
1010
UnicodeNormalization.cpp)
1111
else()
12+
find_package(ICU REQUIRED COMPONENTS uc i18n)
1213
set(swift_stubs_unicode_normalization_sources
1314
UnicodeNormalization.cpp)
15+
include_directories(
16+
${ICU_UC_INCLUDE_DIR} ${ICU_I18N_INCLUDE_DIR})
1417
endif()
1518

1619
add_swift_library(swiftStdlibStubs OBJECT_LIBRARY TARGET_LIBRARY

0 commit comments

Comments
 (0)