[Lldb-commits] [PATCH] D14740: Define LLDB_DISABLE_CURSES as a fallback for missing curses(3) or panel(3)

Kamil Rytarowski via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 16 20:21:44 PST 2015


krytarowski created this revision.
krytarowski added reviewers: clayborg, emaste.
krytarowski added subscribers: lldb-commits, joerg, brucem.
krytarowski set the repository for this revision to rL LLVM.

This enables build on NetBSD-7.0. It would be nice to have a fall-back for
externally provided ncurses via pkgsrc, but it's left after the scheduled drop
of the autoconf/gmake build system. For not it's not worth the effort.

Repository:
  rL LLVM

http://reviews.llvm.org/D14740

Files:
  cmake/modules/LLDBConfig.cmake

Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -2,6 +2,8 @@
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
+include(CheckIncludeFiles)
+
 set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
   # The Darwin linker doesn't understand --start-group/--end-group.
@@ -42,6 +44,23 @@
   add_definitions( -DHAVE_ROUND )
 endif()
 
+if (NOT LLDB_DISABLE_CURSES)
+    find_package(Curses)
+
+    find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
+    check_include_files(panel.h HAVE_PANEL_H)
+    if (NOT CURSES_FOUND OR NOT CURSES_PANEL_LIBRARY OR NOT HAVE_PANEL_H)
+        message("-- Unable to find pair curses and libpanel")
+        set(LLDB_DISABLE_CURSES 1)
+    else ()
+        # 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 ()
+endif ()
+
 if (LLDB_DISABLE_CURSES)
   add_definitions( -DLLDB_DISABLE_CURSES )
 endif()
@@ -395,18 +414,3 @@
 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 ()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14740.40369.patch
Type: text/x-patch
Size: 1884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151117/6772cda7/attachment-0001.bin>


More information about the lldb-commits mailing list