[Lldb-commits] [lldb] a4304f9 - [lldb/CMake] Rename LLDB_DISABLE_CURSES to LLDB_ENABLE_CURSES

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 12 09:13:39 PST 2019


Author: Jonas Devlieghere
Date: 2019-12-12T09:13:31-08:00
New Revision: a4304f96d6baba92baa9db1eef0ed647f76306f6

URL: https://github.com/llvm/llvm-project/commit/a4304f96d6baba92baa9db1eef0ed647f76306f6
DIFF: https://github.com/llvm/llvm-project/commit/a4304f96d6baba92baa9db1eef0ed647f76306f6.diff

LOG: [lldb/CMake] Rename LLDB_DISABLE_CURSES to LLDB_ENABLE_CURSES

This matches the naming scheme used by LLVM.

Differential revision: https://reviews.llvm.org/D71377

Added: 
    

Modified: 
    lldb/cmake/modules/LLDBConfig.cmake
    lldb/docs/resources/build.rst
    lldb/include/lldb/Host/Config.h.cmake
    lldb/source/API/SBDebugger.cpp
    lldb/source/Commands/CommandObjectGUI.cpp
    lldb/source/Core/CMakeLists.txt
    lldb/source/Core/IOHandlerCursesGUI.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 8d5c5fc08cfa..4c0554e4cb6e 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -25,27 +25,27 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw
 endif()
 
 set(default_disable_python OFF)
-set(default_disable_curses OFF)
 set(default_disable_libedit OFF)
+set(default_enable_curses ON)
 
 if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
   set(default_disable_libedit ON)
 endif()
 
 if(CMAKE_SYSTEM_NAME MATCHES "Windows")
-  set(default_disable_curses ON)
   set(default_disable_libedit ON)
+  set(default_enable_curses OFF)
 elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
   set(default_disable_python ON)
-  set(default_disable_curses ON)
   set(default_disable_libedit ON)
+  set(default_enable_curses OFF)
 elseif(IOS)
   set(default_disable_python ON)
 endif()
 
 option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." ${default_disable_python})
-option(LLDB_DISABLE_CURSES "Disable Curses integration." ${default_disable_curses})
 option(LLDB_DISABLE_LIBEDIT "Disable the use of editline." ${default_disable_libedit})
+option(LLDB_ENABLE_CURSES "Disable Curses integration." ${default_enable_curses})
 option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to locate Python." OFF)
 option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a copy of it" OFF)
 option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
@@ -485,7 +485,7 @@ else()
     set(LLDB_CAN_USE_DEBUGSERVER OFF)
 endif()
 
-if (NOT LLDB_DISABLE_CURSES)
+if (LLDB_ENABLE_CURSES)
     find_package(Curses REQUIRED)
     find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
     if (NOT CURSES_PANEL_LIBRARY)

diff  --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index eecc32d708e2..0297e65cc381 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -263,7 +263,7 @@ NetBSD
 
 Current stable NetBSD release doesn't ship with libpanel(3), therefore it's
 required to disable curses(3) support with the
-``-DLLDB_DISABLE_CURSES:BOOL=TRUE`` option. To make sure check if
+``-DLLDB_ENABLE_CURSES:BOOL=FALSE`` option. To make sure check if
 ``/usr/include/panel.h`` exists in your system.
 
 macOS
@@ -402,8 +402,8 @@ further by passing the appropriate cmake options, such as:
 ::
 
   -DLLDB_DISABLE_LIBEDIT=1
-  -DLLDB_DISABLE_CURSES=1
   -DLLDB_DISABLE_PYTHON=1
+  -DLLDB_ENABLE_CURSES=0
   -DLLVM_ENABLE_TERMINFO=0
 
 In this case you, will often not need anything other than the standard C and
@@ -455,7 +455,7 @@ to prepare the cmake build with the following parameters:
   -DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \
   -DLLDB_DISABLE_PYTHON=1 \
   -DLLDB_DISABLE_LIBEDIT=1 \
-  -DLLDB_DISABLE_CURSES=1
+  -DLLDB_ENABLE_CURSES=0
 
 An alternative (and recommended) way to compile LLDB is with clang.
 Unfortunately, clang is not able to find all the include paths necessary for a

diff  --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
index 80e415239764..e16f36e06a70 100644
--- a/lldb/include/lldb/Host/Config.h.cmake
+++ b/lldb/include/lldb/Host/Config.h.cmake
@@ -35,9 +35,9 @@
 
 #cmakedefine01 LLDB_ENABLE_LZMA
 
-#cmakedefine LLDB_ENABLE_LIBXML2
+#cmakedefine01 LLDB_ENABLE_CURSES
 
-#cmakedefine LLDB_DISABLE_CURSES
+#cmakedefine LLDB_ENABLE_LIBXML2
 
 #cmakedefine LLDB_DISABLE_LIBEDIT
 

diff  --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index d9dd7d423ae0..769f688b5b78 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -683,12 +683,8 @@ SBStructuredData SBDebugger::GetBuildConfiguration() {
   AddBoolConfigEntry(
       *config_up, "xml", XMLDocument::XMLEnabled(),
       "A boolean value that indicates if XML support is enabled in LLDB");
-  bool have_curses = true;
-#ifdef LLDB_DISABLE_CURSES
-  have_curses = false;
-#endif
   AddBoolConfigEntry(
-      *config_up, "curses", have_curses,
+      *config_up, "curses", LLDB_ENABLE_CURSES,
       "A boolean value that indicates if curses support is enabled in LLDB");
   AddLLVMTargets(*config_up);
 

diff  --git a/lldb/source/Commands/CommandObjectGUI.cpp b/lldb/source/Commands/CommandObjectGUI.cpp
index 0ee526e6adea..5edba33f8bdb 100644
--- a/lldb/source/Commands/CommandObjectGUI.cpp
+++ b/lldb/source/Commands/CommandObjectGUI.cpp
@@ -26,7 +26,7 @@ CommandObjectGUI::CommandObjectGUI(CommandInterpreter &interpreter)
 CommandObjectGUI::~CommandObjectGUI() {}
 
 bool CommandObjectGUI::DoExecute(Args &args, CommandReturnObject &result) {
-#ifndef LLDB_DISABLE_CURSES
+#if LLDB_ENABLE_CURSES
   if (args.GetArgumentCount() == 0) {
     Debugger &debugger = GetDebugger();
 

diff  --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index 0c7f3e376df7..25ce51835715 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -9,7 +9,7 @@ lldb_tablegen(CorePropertiesEnum.inc -gen-lldb-property-enum-defs
 set(LLDB_CURSES_LIBS)
 set(LLDB_LIBEDIT_LIBS)
 
-if (NOT LLDB_DISABLE_CURSES)
+if (LLDB_ENABLE_CURSES)
   list(APPEND LLDB_CURSES_LIBS ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
   if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
     list(APPEND LLDB_CURSES_LIBS ${TERMINFO_LIBS})
@@ -102,6 +102,6 @@ if (NOT LLDB_DISABLE_LIBEDIT)
   target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
 endif()
 
-if (NOT LLDB_DISABLE_CURSES)
+if (LLDB_ENABLE_CURSES)
   target_include_directories(lldbCore PRIVATE ${CURSES_INCLUDE_DIR})
 endif()

diff  --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index 23c185ada1a0..1661b465efaf 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -9,7 +9,7 @@
 #include "lldb/Core/IOHandlerCursesGUI.h"
 #include "lldb/Host/Config.h"
 
-#ifndef LLDB_DISABLE_CURSES
+#if LLDB_ENABLE_CURSES
 #include <curses.h>
 #include <panel.h>
 #endif
@@ -31,7 +31,7 @@
 #include "lldb/Interpreter/CommandCompletions.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 
-#ifndef LLDB_DISABLE_CURSES
+#if LLDB_ENABLE_CURSES
 #include "lldb/Breakpoint/BreakpointLocation.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ValueObject.h"
@@ -74,7 +74,7 @@ using llvm::Optional;
 using llvm::StringRef;
 
 // we may want curses to be disabled for some builds for instance, windows
-#ifndef LLDB_DISABLE_CURSES
+#if LLDB_ENABLE_CURSES
 
 #define KEY_RETURN 10
 #define KEY_ESCAPE 27
@@ -4064,4 +4064,4 @@ bool IOHandlerCursesGUI::Interrupt() { return false; }
 
 void IOHandlerCursesGUI::GotEOF() {}
 
-#endif // LLDB_DISABLE_CURSES
+#endif // LLDB_ENABLE_CURSES


        


More information about the lldb-commits mailing list