File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -259,22 +259,31 @@ endif()
259259
260260#Check for icu.
261261if (LLVM_ENABLE_ICU)
262- find_package (ICU COMPONENTS uc i18n)
263- if (ICU_FOUND)
264- set (HAVE_ICU 1)
262+ set (LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} )
263+ set (CMAKE_FIND_LIBRARY_SUFFIXES ".so" )
264+ if (LLVM_ENABLE_ICU STREQUAL FORCE_ON)
265+ find_package (ICU REQUIRED COMPONENTS uc i18n)
266+ if (NOT ICU_FOUND)
267+ message (FATAL_ERROR "Failed to configure icu, but LLVM_ENABLE_ICU is FORCE_ON" )
268+ endif ()
265269 else ()
266- set (HAVE_ICU 0 )
270+ find_package (ICU COMPONENTS uc i18n )
267271 endif ()
272+ set (HAVE_ICU ${ICU_FOUND} )
273+ set (CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES} )
268274endif ()
269275
270276# Check for iconv.
271277if (LLVM_ENABLE_ICONV)
272- find_package (Iconv)
273- if (Iconv_FOUND)
274- set (HAVE_ICONV 1)
278+ if (LLVM_ENABLE_ICONV STREQUAL FORCE_ON)
279+ find_package (Iconv REQUIRED)
280+ if (NOT Iconv_FOUND)
281+ message (FATAL_ERROR "Failed to configure iconv, but LLVM_ENABLE_ICONV is FORCE_ON" )
282+ endif ()
275283 else ()
276- set (HAVE_ICONV 0 )
284+ find_package (Iconv )
277285 endif ()
286+ set (HAVE_ICONV ${Iconv_FOUND} )
278287endif ()
279288
280289# function checks
You can’t perform that action at this time.
0 commit comments