build: use cmake to find the libedit content

Use proper cmake techniques to detect where the libedit package resides.
This allows for the use of libedit from an alternative location which is
needed for supporting cross-compilation.

llvm-svn: 333041
This commit is contained in:
Saleem Abdulrasool
2018-05-22 23:24:46 +00:00
parent 3a9e2ca051
commit 9426358ea1
3 changed files with 68 additions and 1 deletions

View File

@@ -6,9 +6,12 @@ SET(PYTHON_DIRECTORY python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-
# Build the readline python module
include_directories(${PYTHON_INCLUDE_DIR})
add_library(readline SHARED readline.cpp)
target_include_directories(readline
PRIVATE
${libedit_INCLUDE_DIRS})
if (NOT LLDB_DISABLE_LIBEDIT)
target_link_libraries(readline ${PYTHON_LIBRARY} edit)
target_link_libraries(readline ${PYTHON_LIBRARY} ${libedit_LIBRARIES})
else()
target_link_libraries(readline ${PYTHON_LIBRARY})
endif()