Skip to content

Commit 2f9498a

Browse files
committed
build: use the target variables for the ICU check
The ICU library is used for the target library, not the host tools. Use the appropriate variable `SWIFT_PRIMARY_VARIANT_SDK` and `SWIFT_PRIMARY_VARIANT_ARCH` to select the right CMake variables for the ICU definitions. There is no need to use the `_default` suffixed versions as the defaults have already been used to set the value above.
1 parent 814e656 commit 2f9498a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,15 +860,14 @@ function(swift_icu_variables_set sdk arch result)
860860
endif()
861861
endfunction()
862862

863-
# ICU is provided through CoreFoundation on Darwin. On other hosts, assume that
864-
# we are compiling for the build as the host. In such a case, if the ICU
863+
# ICU is provided through CoreFoundation on Darwin. On other hosts, if the ICU
865864
# unicode and i18n include and library paths are not defined, perform a standard
866865
# package lookup. Otherwise, rely on the paths specified by the user. These
867866
# need to be defined when cross-compiling.
868867
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
869868
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
870-
swift_icu_variables_set("${SWIFT_HOST_VARIANT_SDK_default}"
871-
"${SWIFT_HOST_VARIANT_ARCH_default}"
869+
swift_icu_variables_set("${SWIFT_PRIMARY_VARIANT_SDK}"
870+
"${SWIFT_PRIMARY_VARIANT_ARCH}"
872871
ICU_CONFIGURED)
873872
if("${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "" AND NOT ${ICU_CONFIGURED})
874873
find_package(ICU REQUIRED COMPONENTS uc i18n)

0 commit comments

Comments
 (0)