Ncurses related symbols can either all be found in libnurses or split between
libncurses and libtinfo. The main LLVM cmake scripts look for the setupterm
symbol and stores the library that has it in TERMINFO_LIBS. This covers the
split and unified ncurses case. LLDB uses symbols that can end up in libtinfo so
this library should be pulled in if it is found.
There is still an exotic case left where LLDB is configured with
-DLLDB_DISABLE_CURSES=NO and LLVM with -DLLVM_ENABLE_TERMINFO=NO but
misconfigurations will always be possible. Possibly a diagnostic could be added
for that.
This fixes bug 24693 (https://llvm.org/bugs/show_bug.cgi?id=24693).