Skip to content

Commit eeaf034

Browse files
committed
switch default to OFF, add error if both ICU/ICONV are turned on, only check for iconv if icu was not found
1 parent f4e3ec2 commit eeaf034

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

llvm/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ else()
572572
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
573573
endif()
574574

575-
set(LLVM_ENABLE_ICU "ON" CACHE STRING "Use ICU for character conversion support if available. Can be ON, OFF, or FORCE_ON")
575+
set(LLVM_ENABLE_ICU "OFF" CACHE STRING "Use ICU for character conversion support if available. Can be ON, OFF, or FORCE_ON")
576576

577-
set(LLVM_ENABLE_ICONV "ON" CACHE STRING "Use iconv for character conversion support if available. Can be ON, OFF, or FORCE_ON")
577+
set(LLVM_ENABLE_ICONV "OFF" CACHE STRING "Use iconv for character conversion support if available. Can be ON, OFF, or FORCE_ON")
578578

579579
set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
580580

llvm/cmake/config-ix.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,12 @@ if(LLVM_HAS_LOGF128)
294294
set(LLVM_HAS_LOGF128 "${HAS_LOGF128}")
295295
endif()
296296

297+
if (LLVM_ENABLE_ICU STREQUAL FORCE_ON AND LLVM_ENABLE_ICONV STREQUAL FORCE_ON)
298+
message(FATAL_ERROR "Both LLVM_ENABLE_ICU and LLVM_ENABLE_ICONV should not be FORCE_ON")
299+
endif()
300+
297301
# Check for ICU.
298-
if(LLVM_ENABLE_ICU)
302+
if(LLVM_ENABLE_ICU AND NOT(LLVM_ENABLE_ICONV STREQUAL FORCE_ON))
299303
set(LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
300304
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
301305
if (LLVM_ENABLE_ICU STREQUAL FORCE_ON)
@@ -311,7 +315,7 @@ if(LLVM_ENABLE_ICU)
311315
endif()
312316

313317
# Check for builtin iconv to avoid licensing issues.
314-
if(LLVM_ENABLE_ICONV)
318+
if(LLVM_ENABLE_ICONV AND NOT HAVE_ICU)
315319
if (LLVM_ENABLE_ICONV STREQUAL FORCE_ON)
316320
find_package(Iconv REQUIRED)
317321
if (NOT Iconv_FOUND OR NOT Iconv_IS_BUILT_IN)

0 commit comments

Comments
 (0)