diff --git a/CMakeLists.txt b/CMakeLists.txt index 216702eabaf..53059e63d3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,7 @@ set(LLVM_TARGET_ARCH "host" option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON) -option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON) +set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON") option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 7f33591de0c..23494fb96c6 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -170,6 +170,10 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*") endif() endif() +if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED) + message(FATAL_ERROR "Failed to congifure libxml2") +endif() + check_library_exists(xar xar_open "" HAVE_LIBXAR) if(HAVE_LIBXAR) set(XAR_LIB xar)