diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -220,8 +220,12 @@ if (NOT PURE_WINDOWS) # Skip libedit if using ASan as it contains memory leaks. if (LLVM_ENABLE_LIBEDIT AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") - find_package(LibEdit) - set(HAVE_LIBEDIT ${LibEdit_FOUND}) + if(LLVM_ENABLE_LIBEDIT STREQUAL FORCE_ON) + find_package(LibEdit REQUIRED) + else() + find_package(LibEdit) + endif() + set(HAVE_LIBEDIT "${LibEdit_FOUND}") else() set(HAVE_LIBEDIT 0) endif() @@ -234,9 +238,11 @@ set(LLVM_ENABLE_TERMINFO "${Terminfo_FOUND}") endif() else() + set(HAVE_LIBEDIT 0) set(LLVM_ENABLE_TERMINFO 0) endif() else() + set(HAVE_LIBEDIT 0) set(LLVM_ENABLE_TERMINFO 0) endif() diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in --- a/llvm/cmake/modules/LLVMConfig.cmake.in +++ b/llvm/cmake/modules/LLVMConfig.cmake.in @@ -58,6 +58,11 @@ set(LLVM_ENABLE_RTTI @LLVM_ENABLE_RTTI@) +set(LLVM_ENABLE_LIBEDIT @HAVE_LIBEDIT@) +if(LLVM_ENABLE_LIBEDIT) + find_package(LibEdit) +endif() + set(LLVM_ENABLE_TERMINFO @LLVM_ENABLE_TERMINFO@) if(LLVM_ENABLE_TERMINFO) find_package(Terminfo)