Use library discovery for curses and panel

Summary:
This approach is tunable with custom paths for curses library.

It also detects whether there are requirements met.

I make use of it on NetBSD.

Patch by Kamil Rytarowski. Thanks!

Reviewers: clayborg

Subscribers: brucem, joerg, lldb-commits

Differential Revision: http://reviews.llvm.org/D14529

llvm-svn: 253151
This commit is contained in:
Bruce Mitchener
2015-11-15 01:53:23 +00:00
parent 5219ecf068
commit eb0a6f4308
2 changed files with 17 additions and 2 deletions

View File

@@ -146,7 +146,7 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT __ANDROID_NDK__)
list(APPEND LLDB_SYSTEM_LIBS edit)
endif()
if (NOT LLDB_DISABLE_CURSES)
list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
endif()

View File

@@ -309,7 +309,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
add_definitions( -DLIBXML2_DEFINED )
list(APPEND system_libs xml2 ncurses panel)
list(APPEND system_libs xml2 ${CURSES_LIBRARIES})
list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
${DEBUG_SYMBOLS_LIBRARY})
@@ -395,3 +395,18 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
else()
set(LLDB_CAN_USE_DEBUGSERVER 0)
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})
endif ()