Skip to content

Commit e2fc524

Browse files
committed
handle FORCE_ON
1 parent 3b6b2bf commit e2fc524

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,28 @@ endif()
259259

260260
#Check for icu.
261261
if(LLVM_ENABLE_ICU)
262-
find_package(ICU COMPONENTS uc i18n)
263-
if(ICU_FOUND)
264-
set(HAVE_ICU 1)
262+
if (LLVM_ENABLE_ICU STREQUAL FORCE_ON)
263+
find_package(ICU REQUIRED COMPONENTS uc i18n)
264+
if (NOT ICU_FOUND)
265+
message(FATAL_ERROR "Failed to configure icu, but LLVM_ENABLE_ICU is FORCE_ON")
266+
endif()
265267
else()
266-
set(HAVE_ICU 0)
268+
find_package(ICU COMPONENTS uc i18n)
267269
endif()
270+
set(HAVE_ICU ${ICU_FOUND})
268271
endif()
269272

270273
# Check for iconv.
271274
if(LLVM_ENABLE_ICONV)
272-
find_package(Iconv)
273-
if(Iconv_FOUND)
274-
set(HAVE_ICONV 1)
275+
if (LLVM_ENABLE_ICONV STREQUAL FORCE_ON)
276+
find_package(Iconv REQUIRED)
277+
if (NOT Iconv_FOUND)
278+
message(FATAL_ERROR "Failed to configure iconv, but LLVM_ENABLE_ICONV is FORCE_ON")
279+
endif()
275280
else()
276-
set(HAVE_ICONV 0)
281+
find_package(Iconv)
277282
endif()
283+
set(HAVE_ICONV ${Iconv_FOUND})
278284
endif()
279285

280286
# function checks

0 commit comments

Comments
 (0)