Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -122,9 +122,11 @@ # Look for terminfo library, used in unittests that depend on LLVMSupport. if(LLVM_ENABLE_TERMINFO) foreach(library tinfo terminfo curses ncurses ncursesw) + string(TOUPPER ${library} library_suffix) check_library_exists( - ${library} setupterm "" COMPILER_RT_HAS_TERMINFO) - if(COMPILER_RT_HAS_TERMINFO) + ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix}) + if(COMPILER_RT_HAS_TERMINFO_${library_suffix}) + set(COMPILER_RT_HAS_TERMINFO TRUE) set(COMPILER_RT_TERMINFO_LIB "${library}") break() endif()