Skip to content

Commit 7f50ed8

Browse files
committed
add LLVM_ENABLE_ICU and LLVM_ENABLE_ICONV option
1 parent e6d46cf commit 7f50ed8

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

llvm/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ else()
554554
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
555555
endif()
556556

557+
set(LLVM_ENABLE_ICU "ON" CACHE STRING "Use ICU for character conversion support if available. Can be ON, OFF, or FORCE_ON")
558+
559+
set(LLVM_ENABLE_ICONV "ON" CACHE STRING "Use iconv for character conversion support if available. Can be ON, OFF, or FORCE_ON")
560+
557561
set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
558562

559563
set(LLVM_ENABLE_ZSTD "ON" CACHE STRING "Use zstd for compression/decompression if available. Can be ON, OFF, or FORCE_ON")

llvm/cmake/config-ix.cmake

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,23 @@ else()
258258
endif()
259259

260260
#Check for icu.
261-
find_package(ICU COMPONENTS uc i18n)
262-
if(ICU_FOUND)
263-
set(HAVE_ICU 1)
264-
else()
265-
set(HAVE_ICU 0)
261+
if(LLVM_ENABLE_ICU)
262+
find_package(ICU COMPONENTS uc i18n)
263+
if(ICU_FOUND)
264+
set(HAVE_ICU 1)
265+
else()
266+
set(HAVE_ICU 0)
267+
endif()
266268
endif()
267269

268270
# Check for iconv.
269-
find_package(Iconv)
270-
if(Iconv_FOUND)
271-
set(HAVE_ICONV 1)
272-
else()
273-
set(HAVE_ICONV 0)
271+
if(LLVM_ENABLE_ICONV)
272+
find_package(Iconv)
273+
if(Iconv_FOUND)
274+
set(HAVE_ICONV 1)
275+
else()
276+
set(HAVE_ICONV 0)
277+
endif()
274278
endif()
275279

276280
# function checks

0 commit comments

Comments
 (0)