diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -138,7 +138,9 @@ else() set(MAYBE_REQUIRED) endif() -find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) +if(LLVM_ENABLE_TERMINFO) + find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) +endif() if(COMPILER_RT_TERMINFO_LIB) set(LLVM_ENABLE_TERMINFO 1) else() 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 @@ -152,7 +152,9 @@ else() set(MAYBE_REQUIRED) endif() - find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) + if(LLVM_ENABLE_TERMINFO) + find_library(TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) + endif() if(TERMINFO_LIB) set(LLVM_ENABLE_TERMINFO 1) else()