]> granicus.if.org Git - llvm/commitdiff
Add an option to disable libedit
authorYichao Yu <yyc1992@gmail.com>
Fri, 18 Nov 2016 01:25:49 +0000 (01:25 +0000)
committerYichao Yu <yyc1992@gmail.com>
Fri, 18 Nov 2016 01:25:49 +0000 (01:25 +0000)
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

CMakeLists.txt
cmake/config-ix.cmake

index 2e9a4a1453287ac26081fce23abb35c46880d777..2f0cb41705d53582450c535eb400e34ecad0e2c7 100644 (file)
@@ -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)
index be67c5667d7ab7b2be49d68cb616cf41f62da798..3e37e5854279d2b3a0f717bfb6f8d2a8feadf187 100755 (executable)
@@ -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)