summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-01-02 13:31:32 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-01-02 13:39:57 -0800
commitf38234ed8b579230a3742317ffd5fb95514d9638 (patch)
tree06f7e857c60e34af36618f56147bcae3dc414bfe
parent982695c0693fe576fb9daa34ecbf81808efdaa2f (diff)
downloadbcm5719-llvm-f38234ed8b579230a3742317ffd5fb95514d9638.tar.gz
bcm5719-llvm-f38234ed8b579230a3742317ffd5fb95514d9638.zip
[lldb/CMake] Fix variable naming in FindLibEdit
The current FOUND_VAR for FindLibEdit is libedit_FOUND but wasn't set by find_package_handle_standard_args. However this isn't valid for the package name. The argument for FOUND_VAR is "libedit_FOUND", but only "LibEdit_FOUND" and "LIBEDIT_FOUND" are valid names. This fixes all the variables set by FindLibEdit to match the desired naming scheme.
-rw-r--r--lldb/cmake/modules/FindLibEdit.cmake34
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake6
-rw-r--r--lldb/source/Core/CMakeLists.txt2
-rw-r--r--lldb/source/Host/CMakeLists.txt6
-rw-r--r--lldb/source/Interpreter/CMakeLists.txt2
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt4
6 files changed, 28 insertions, 26 deletions
diff --git a/lldb/cmake/modules/FindLibEdit.cmake b/lldb/cmake/modules/FindLibEdit.cmake
index df8f2abb016..b4f0cb32981 100644
--- a/lldb/cmake/modules/FindLibEdit.cmake
+++ b/lldb/cmake/modules/FindLibEdit.cmake
@@ -8,25 +8,25 @@
#
# ::
#
-# libedit_FOUND - true if libedit was found
-# libedit_INCLUDE_DIRS - include search path
-# libedit_LIBRARIES - libraries to link
-# libedit_VERSION - version number
+# LibEdit_FOUND - true if libedit was found
+# LibEdit_INCLUDE_DIRS - include search path
+# LibEdit_LIBRARIES - libraries to link
+# LibEdit_VERSION_STRING - version number
-if(libedit_INCLUDE_DIRS AND libedit_LIBRARIES)
- set(libedit_FOUND TRUE)
+if(LibEdit_INCLUDE_DIRS AND LibEdit_LIBRARIES)
+ set(LibEdit_FOUND TRUE)
else()
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBEDIT QUIET libedit)
- find_path(libedit_INCLUDE_DIRS
+ find_path(LibEdit_INCLUDE_DIRS
NAMES
histedit.h
HINTS
${PC_LIBEDIT_INCLUDEDIR}
${PC_LIBEDIT_INCLUDE_DIRS}
${CMAKE_INSTALL_FULL_INCLUDEDIR})
- find_library(libedit_LIBRARIES
+ find_library(LibEdit_LIBRARIES
NAMES
edit libedit
HINTS
@@ -34,29 +34,31 @@ else()
${PC_LIBEDIT_LIBRARY_DIRS}
${CMAKE_INSTALL_FULL_LIBDIR})
- if(libedit_INCLUDE_DIRS AND EXISTS "${libedit_INCLUDE_DIRS}/histedit.h")
- file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h"
+ if(LibEdit_INCLUDE_DIRS AND EXISTS "${LibEdit_INCLUDE_DIRS}/histedit.h")
+ file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h"
libedit_major_version_str
REGEX "^#define[ \t]+LIBEDIT_MAJOR[ \t]+[0-9]+")
string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MAJOR[ \t]+([0-9]+)" "\\1"
LIBEDIT_MAJOR_VERSION "${libedit_major_version_str}")
- file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h"
+ file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h"
libedit_minor_version_str
REGEX "^#define[ \t]+LIBEDIT_MINOR[ \t]+[0-9]+")
string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MINOR[ \t]+([0-9]+)" "\\1"
LIBEDIT_MINOR_VERSION "${libedit_minor_version_str}")
- set(libedit_VERSION_STRING "${libedit_major_version}.${libedit_minor_version}")
+ set(LibEdit_VERSION_STRING "${libedit_major_version}.${libedit_minor_version}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibEdit
+ FOUND_VAR
+ LibEdit_FOUND
REQUIRED_VARS
- libedit_INCLUDE_DIRS
- libedit_LIBRARIES
+ LibEdit_INCLUDE_DIRS
+ LibEdit_LIBRARIES
VERSION_VAR
- libedit_VERSION_STRING)
- mark_as_advanced(libedit_INCLUDE_DIRS libedit_LIBRARIES)
+ LibEdit_VERSION_STRING)
+ mark_as_advanced(LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES)
endif()
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 88f39f23527..b77880cc0af 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -45,7 +45,7 @@ macro(add_optional_dependency variable description package found)
endif()
endmacro()
-add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support." LibEdit libedit_FOUND)
+add_optional_dependency(LLDB_ENABLE_LIBEDIT "Enable editline support." LibEdit LibEdit_FOUND)
add_optional_dependency(LLDB_ENABLE_CURSES "Enable curses support." CursesAndPanel CURSESANDPANEL_FOUND)
add_optional_dependency(LLDB_ENABLE_LZMA "Enable LZMA compression support." LibLZMA LIBLZMA_FOUND)
add_optional_dependency(LLDB_ENABLE_LUA "Enable Lua scripting support." Lua LUA_FOUND)
@@ -124,8 +124,8 @@ endif()
# Check if we libedit capable of handling wide characters (built with
# '--enable-widec').
if (LLDB_ENABLE_LIBEDIT)
- set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES})
- set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS})
+ 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)
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index c4be006d1a1..a03fe6f4800 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -99,7 +99,7 @@ add_dependencies(lldbCore
set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4)
if (LLDB_ENABLE_LIBEDIT)
- target_include_directories(lldbCore PRIVATE ${libedit_INCLUDE_DIRS})
+ target_include_directories(lldbCore PRIVATE ${LibEdit_INCLUDE_DIRS})
endif()
if (LLDB_ENABLE_CURSES)
diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index 2da0b939bd4..2e9bb402227 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -156,14 +156,14 @@ if (HAVE_LIBDL)
list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
endif()
if (LLDB_ENABLE_LIBEDIT)
- list(APPEND EXTRA_LIBS ${libedit_LIBRARIES})
+ list(APPEND EXTRA_LIBS ${LibEdit_LIBRARIES})
endif()
if (LLDB_ENABLE_LZMA)
list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES})
endif()
if (LLDB_ENABLE_LIBEDIT)
- list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
+ list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES})
if (LLVM_BUILD_STATIC)
list(APPEND LLDB_SYSTEM_LIBS gpm)
endif()
@@ -184,5 +184,5 @@ add_lldb_library(lldbHost
)
if (LLDB_ENABLE_LIBEDIT)
- target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS})
+ target_include_directories(lldbHost PUBLIC ${LibEdit_INCLUDE_DIRS})
endif()
diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt
index be9843e1101..0ed39869467 100644
--- a/lldb/source/Interpreter/CMakeLists.txt
+++ b/lldb/source/Interpreter/CMakeLists.txt
@@ -70,5 +70,5 @@ add_dependencies(lldbInterpreter
LLDBInterpreterPropertiesEnumGen)
if (LLDB_ENABLE_LIBEDIT)
- target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS})
+ target_include_directories(lldbInterpreter PRIVATE ${LibEdit_INCLUDE_DIRS})
endif()
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
index 9088afe8140..761772f3a37 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
@@ -4,7 +4,7 @@ endif()
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${LLDB_PYTHON_RELATIVE_PATH}")
if (LLDB_ENABLE_LIBEDIT)
- list(APPEND LLDB_LIBEDIT_LIBS ${libedit_LIBRARIES})
+ list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES})
endif()
add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
@@ -28,6 +28,6 @@ add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
if (LLDB_ENABLE_LIBEDIT)
target_include_directories(lldbPluginScriptInterpreterPython PUBLIC
- ${libedit_INCLUDE_DIRS}
+ ${LibEdit_INCLUDE_DIRS}
)
endif()
OpenPOWER on IntegriCloud