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()
259
259
260
260
#Check for icu.
261
261
if (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 ()
265
269
else ()
266
- set ( HAVE_ICU 0 )
270
+ find_package ( ICU COMPONENTS uc i18n )
267
271
endif ()
272
+ set (HAVE_ICU ${ICU_FOUND} )
273
+ set (CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES} )
268
274
endif ()
269
275
270
276
# Check for iconv.
271
277
if (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 ()
275
283
else ()
276
- set ( HAVE_ICONV 0 )
284
+ find_package ( Iconv )
277
285
endif ()
286
+ set (HAVE_ICONV ${Iconv_FOUND} )
278
287
endif ()
279
288
280
289
# function checks
You can’t perform that action at this time.
0 commit comments