From: Yichao Yu Date: Fri, 18 Nov 2016 01:25:49 +0000 (+0000) Subject: Add an option to disable libedit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc5eb2165eb2e7060104649fa19899ae5595628a;p=llvm Add an option to disable libedit Summary: This should provide the function similar to `--disable-libedit` with the autotools build system, which seems to be missing from the commit (r200595) that adds this. Reviewers: pcc, beanz Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26550 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287293 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e9a4a14532..2f0cb41705d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,6 +357,8 @@ set(LLVM_TARGET_ARCH "host" option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON) +option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON) + option(LLVM_ENABLE_THREADS "Use threads if available." ON) option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON) diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index be67c5667d7..3e37e585427 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -119,8 +119,10 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*") set(HAVE_LIBZ 0) endif() # Skip libedit if using ASan as it contains memory leaks. - if (HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") + if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") check_library_exists(edit el_init "" HAVE_LIBEDIT) + else() + set(HAVE_LIBEDIT 0) endif() if(LLVM_ENABLE_TERMINFO) set(HAVE_TERMINFO 0)