forked from OSchip/llvm-project
[lldb/CMake] Rename LLDB_DISABLE_LIBEDIT to LLDB_ENABLE_LIBEDIT
This matches the naming scheme used by LLVM. Differential revision: https://reviews.llvm.org/D71380
This commit is contained in:
parent
bd12a322d7
commit
62456e579e
|
@ -25,7 +25,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darw
|
|||
endif()
|
||||
|
||||
set(default_disable_python OFF)
|
||||
set(default_disable_libedit OFF)
|
||||
set(default_enable_libedit ON)
|
||||
set(default_enable_curses ON)
|
||||
|
||||
if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
|
||||
|
@ -33,18 +33,18 @@ if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
|
|||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(default_disable_libedit ON)
|
||||
set(default_enable_libedit OFF)
|
||||
set(default_enable_curses OFF)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
|
||||
set(default_disable_python ON)
|
||||
set(default_disable_libedit ON)
|
||||
set(default_enable_libedit OFF)
|
||||
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_LIBEDIT "Disable the use of editline." ${default_disable_libedit})
|
||||
option(LLDB_ENABLE_LIBEDIT "Disable the use of editline." ${default_enable_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)
|
||||
|
@ -109,7 +109,7 @@ if ((NOT MSVC) OR MSVC12)
|
|||
endif()
|
||||
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
find_package(LibEdit REQUIRED)
|
||||
|
||||
# Check if we libedit capable of handling wide characters (built with
|
||||
|
|
|
@ -401,8 +401,8 @@ further by passing the appropriate cmake options, such as:
|
|||
|
||||
::
|
||||
|
||||
-DLLDB_DISABLE_LIBEDIT=1
|
||||
-DLLDB_DISABLE_PYTHON=1
|
||||
-DLLDB_ENABLE_LIBEDIT=0
|
||||
-DLLDB_ENABLE_CURSES=0
|
||||
-DLLVM_ENABLE_TERMINFO=0
|
||||
|
||||
|
@ -454,7 +454,7 @@ to prepare the cmake build with the following parameters:
|
|||
-DLLVM_TABLEGEN=<path-to-host>/bin/llvm-tblgen \
|
||||
-DCLANG_TABLEGEN=<path-to-host>/bin/clang-tblgen \
|
||||
-DLLDB_DISABLE_PYTHON=1 \
|
||||
-DLLDB_DISABLE_LIBEDIT=1 \
|
||||
-DLLDB_ENABLE_LIBEDIT=0 \
|
||||
-DLLDB_ENABLE_CURSES=0
|
||||
|
||||
An alternative (and recommended) way to compile LLDB is with clang.
|
||||
|
|
|
@ -407,7 +407,7 @@ public:
|
|||
void PrintAsync(Stream *stream, const char *s, size_t len) override;
|
||||
|
||||
private:
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
static bool IsInputCompleteCallback(Editline *editline, StringList &lines,
|
||||
void *baton);
|
||||
|
||||
|
@ -418,7 +418,7 @@ private:
|
|||
#endif
|
||||
|
||||
protected:
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
std::unique_ptr<Editline> m_editline_up;
|
||||
#endif
|
||||
IOHandlerDelegate &m_delegate;
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
|
||||
#cmakedefine01 LLDB_ENABLE_CURSES
|
||||
|
||||
#cmakedefine LLDB_ENABLE_LIBXML2
|
||||
#cmakedefine01 LLDB_ENABLE_LIBEDIT
|
||||
|
||||
#cmakedefine LLDB_DISABLE_LIBEDIT
|
||||
#cmakedefine LLDB_ENABLE_LIBXML2
|
||||
|
||||
#cmakedefine LLDB_DISABLE_PYTHON
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ add_dependencies(lldbCore
|
|||
# TODO: Remove once we have better layering
|
||||
set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4)
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "lldb/Utility/StringList.h"
|
||||
#include "lldb/lldb-forward.h"
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
#include "lldb/Host/Editline.h"
|
||||
#endif
|
||||
#include "lldb/Interpreter/CommandCompletions.h"
|
||||
|
@ -234,7 +234,7 @@ IOHandlerEditline::IOHandlerEditline(
|
|||
IOHandlerDelegate &delegate, repro::DataRecorder *data_recorder)
|
||||
: IOHandler(debugger, type, input_sp, output_sp, error_sp, flags,
|
||||
data_recorder),
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
m_editline_up(),
|
||||
#endif
|
||||
m_delegate(delegate), m_prompt(), m_continuation_prompt(),
|
||||
|
@ -244,7 +244,7 @@ IOHandlerEditline::IOHandlerEditline(
|
|||
m_editing(false) {
|
||||
SetPrompt(prompt);
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
bool use_editline = false;
|
||||
|
||||
use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() &&
|
||||
|
@ -272,7 +272,7 @@ IOHandlerEditline::IOHandlerEditline(
|
|||
}
|
||||
|
||||
IOHandlerEditline::~IOHandlerEditline() {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
m_editline_up.reset();
|
||||
#endif
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ static Optional<std::string> SplitLineEOF(std::string &line_buffer) {
|
|||
}
|
||||
|
||||
bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up) {
|
||||
bool b = m_editline_up->GetLine(line, interrupted);
|
||||
if (b && m_data_recorder)
|
||||
|
@ -402,7 +402,7 @@ bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
|
|||
return (bool)got_line;
|
||||
}
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
bool IOHandlerEditline::IsInputCompleteCallback(Editline *editline,
|
||||
StringList &lines,
|
||||
void *baton) {
|
||||
|
@ -429,14 +429,14 @@ void IOHandlerEditline::AutoCompleteCallback(CompletionRequest &request,
|
|||
#endif
|
||||
|
||||
const char *IOHandlerEditline::GetPrompt() {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up) {
|
||||
return m_editline_up->GetPrompt();
|
||||
} else {
|
||||
#endif
|
||||
if (m_prompt.empty())
|
||||
return nullptr;
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
}
|
||||
#endif
|
||||
return m_prompt.c_str();
|
||||
|
@ -445,7 +445,7 @@ const char *IOHandlerEditline::GetPrompt() {
|
|||
bool IOHandlerEditline::SetPrompt(llvm::StringRef prompt) {
|
||||
m_prompt = prompt;
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
m_editline_up->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str());
|
||||
#endif
|
||||
|
@ -460,7 +460,7 @@ const char *IOHandlerEditline::GetContinuationPrompt() {
|
|||
void IOHandlerEditline::SetContinuationPrompt(llvm::StringRef prompt) {
|
||||
m_continuation_prompt = prompt;
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
m_editline_up->SetContinuationPrompt(m_continuation_prompt.empty()
|
||||
? nullptr
|
||||
|
@ -473,7 +473,7 @@ void IOHandlerEditline::SetBaseLineNumber(uint32_t line) {
|
|||
}
|
||||
|
||||
uint32_t IOHandlerEditline::GetCurrentLineIndex() const {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
return m_editline_up->GetCurrentLine();
|
||||
#endif
|
||||
|
@ -484,7 +484,7 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
|
|||
m_current_lines_ptr = &lines;
|
||||
|
||||
bool success = false;
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up) {
|
||||
return m_editline_up->GetLines(m_base_line_number, lines, interrupted);
|
||||
} else {
|
||||
|
@ -514,7 +514,7 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
|
|||
}
|
||||
}
|
||||
success = lines.GetSize() > 0;
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
}
|
||||
#endif
|
||||
return success;
|
||||
|
@ -554,7 +554,7 @@ void IOHandlerEditline::Run() {
|
|||
}
|
||||
|
||||
void IOHandlerEditline::Cancel() {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
m_editline_up->Cancel();
|
||||
#endif
|
||||
|
@ -565,7 +565,7 @@ bool IOHandlerEditline::Interrupt() {
|
|||
if (m_delegate.IOHandlerInterrupt(*this))
|
||||
return true;
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
return m_editline_up->Interrupt();
|
||||
#endif
|
||||
|
@ -573,14 +573,14 @@ bool IOHandlerEditline::Interrupt() {
|
|||
}
|
||||
|
||||
void IOHandlerEditline::GotEOF() {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
m_editline_up->Interrupt();
|
||||
#endif
|
||||
}
|
||||
|
||||
void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) {
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
if (m_editline_up)
|
||||
m_editline_up->PrintAsync(stream, s, len);
|
||||
else
|
||||
|
|
|
@ -52,7 +52,7 @@ add_host_subdirectory(common
|
|||
common/XML.cpp
|
||||
)
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
add_host_subdirectory(common
|
||||
common/Editline.cpp
|
||||
)
|
||||
|
@ -155,14 +155,14 @@ endif ()
|
|||
if (HAVE_LIBDL)
|
||||
list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
list(APPEND EXTRA_LIBS ${libedit_LIBRARIES})
|
||||
endif()
|
||||
if (LLDB_ENABLE_LZMA)
|
||||
list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
|
||||
if (LLVM_BUILD_STATIC)
|
||||
list(APPEND LLDB_SYSTEM_LIBS gpm)
|
||||
|
@ -183,6 +183,6 @@ add_lldb_library(lldbHost
|
|||
Support
|
||||
)
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
|
|
@ -69,6 +69,6 @@ add_dependencies(lldbInterpreter
|
|||
LLDBInterpreterPropertiesGen
|
||||
LLDBInterpreterPropertiesEnumGen)
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include "lldb/Utility/Timer.h"
|
||||
|
||||
#include "lldb/Host/Config.h"
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
#include "lldb/Host/Editline.h"
|
||||
#endif
|
||||
#include "lldb/Host/Host.h"
|
||||
|
|
|
@ -3,7 +3,7 @@ if(NOT LLDB_PYTHON_RELATIVE_PATH)
|
|||
endif()
|
||||
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${LLDB_PYTHON_RELATIVE_PATH}")
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
@ -26,7 +26,7 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
|
|||
Support
|
||||
)
|
||||
|
||||
if (NOT LLDB_DISABLE_LIBEDIT)
|
||||
if (LLDB_ENABLE_LIBEDIT)
|
||||
target_include_directories(lldbPluginScriptInterpreterPython PUBLIC
|
||||
${libedit_INCLUDE_DIRS}
|
||||
)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H
|
||||
#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_PYTHONREADLINE_H
|
||||
|
||||
#if !defined(LLDB_DISABLE_LIBEDIT) && defined(__linux__)
|
||||
#if LLDB_ENABLE_LIBEDIT && defined(__linux__)
|
||||
// NOTE: Since Python may define some pre-processor definitions which affect the
|
||||
// standard headers on some systems, you must include Python.h before any
|
||||
// standard headers are included.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "lldb/Host/Config.h"
|
||||
|
||||
#ifndef LLDB_DISABLE_LIBEDIT
|
||||
#if LLDB_ENABLE_LIBEDIT
|
||||
|
||||
#define EDITLINE_TEST_DUMP_OUTPUT 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue