Index: lldb/cmake/modules/LLDBConfig.cmake =================================================================== --- lldb/cmake/modules/LLDBConfig.cmake +++ lldb/cmake/modules/LLDBConfig.cmake @@ -110,23 +110,29 @@ if (NOT LLDB_DISABLE_LIBEDIT) - find_package(LibEdit REQUIRED) - - # Check if we libedit capable of handling wide characters (built with - # '--enable-widec'). - set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES}) - set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS}) - check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR) - set(CMAKE_EXTRA_INCLUDE_FILES histedit.h) - check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE) - if (LLDB_EL_RFUNC_T_SIZE STREQUAL "") - set(LLDB_HAVE_EL_RFUNC_T 0) + find_package(LibEdit) + + if (libedit_FOUND) + # Check if we libedit capable of handling wide characters (built with + # '--enable-widec'). + set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS}) + check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR) + set(CMAKE_EXTRA_INCLUDE_FILES histedit.h) + check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE) + if (LLDB_EL_RFUNC_T_SIZE STREQUAL "") + set(LLDB_HAVE_EL_RFUNC_T 0) + else() + set(LLDB_HAVE_EL_RFUNC_T 1) + endif() + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_EXTRA_INCLUDE_FILES) else() - set(LLDB_HAVE_EL_RFUNC_T 1) + message(WARNING "LLDB will build without LibEdit support, because it coulnd't be found.") + set(LLDB_DISABLE_LIBEDIT ON FORCE) endif() - set(CMAKE_REQUIRED_LIBRARIES) - set(CMAKE_REQUIRED_INCLUDES) - set(CMAKE_EXTRA_INCLUDE_FILES) + endif() @@ -488,18 +494,22 @@ endif() if (NOT LLDB_DISABLE_CURSES) - find_package(Curses REQUIRED) - - find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library") - if (NOT CURSES_PANEL_LIBRARY) - message(FATAL_ERROR "A required curses' panel library not found.") - endif () - - # Add panels to the library path - set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY}) - - list(APPEND system_libs ${CURSES_LIBRARIES}) - include_directories(${CURSES_INCLUDE_DIR}) + find_package(Curses) + if (CURSES_FOUND) + find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library") + if (NOT CURSES_PANEL_LIBRARY) + message(FATAL_ERROR "A required curses' panel library not found.") + endif () + + # Add panels to the library path + set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY}) + + list(APPEND system_libs ${CURSES_LIBRARIES}) + include_directories(${CURSES_INCLUDE_DIR}) + else() + message(WARNING "LLDB will build without Curses support, because it coulnd't be found.") + set(LLDB_DISABLE_CURSES ON FORCE) + endif() endif () if ((CMAKE_SYSTEM_NAME MATCHES "Android") AND LLVM_BUILD_STATIC AND