1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
macro( FIND_LLDB_OFFICIAL )
# Use CLANG_INCLUDE and CLANG_LIBDIR (from toplevel CMakeLists.txt)
set(LLDB_OFFICIAL_FOUND 1)
set(LIBLLDB lldb-${LLVM_VERSION})
set(LIBLLDB_INCLUDE "${CLANG_INCLUDE}")
set(LIBLLDB_INSTALL_NEEDED 0)
endmacro()
set( BUILD_LLDB 0 )
set( LIBLLDB "" )
set( LIBLLDB_INCLUDE "" )
set( LIBLLDB_INSTALL_NEEDED 0)
set( LLDB_OFFICIAL_FOUND 0)
if (WITH_LLDB MATCHES 1)
if ( APPLE )
set ( LIBLLDB ${CL_SRC_ROOT}/sdk/lldb/unix/lib/liblldb.3.5.0.dylib )
set ( LIBLLDB_INCLUDE ${CL_SRC_ROOT}/sdk/lldb/unix/include )
set ( BUILD_LLDB 1 )
set ( LIBLLDB_INSTALL_NEEDED 1 )
## update search path to include C++11 headers
include_directories(/usr/lib/c++/v1/)
else()
FIND_LLDB_OFFICIAL()
if ( LIBLLDB STREQUAL "LIBLLDB-NOTFOUND" )
## could not locate an official package, try a custom build
find_library(LIBEDIT_LIB NAMES libedit.so HINTS /usr/local/lib /usr/lib ${CMAKE_INSTALL_LIBDIR}) # Our liblldb.so depends on libedit.so
if(NOT LIBEDIT_LIB STREQUAL "LIBEDIT_LIB-NOTFOUND")
set ( LIBLLDB ${CL_SRC_ROOT}/sdk/lldb/unix/lib/${ARCH_NAME}/liblldb.so )
set ( LIBLLDB_INCLUDE ${CL_SRC_ROOT}/sdk/lldb/unix/include )
set ( BUILD_LLDB 1 )
set ( LIBLLDB_INSTALL_NEEDED 1 )
else()
message("-- libedit.so is not installed. For lldb support, please install the libedit development package and try again.")
endif()
else()
set ( BUILD_LLDB 1 )
endif()
endif()
if ( BUILD_LLDB MATCHES 1 )
message("-- LIBLLDB is set to ${LIBLLDB}")
message("-- LIBLLDB_INCLUDE is set to ${LIBLLDB_INCLUDE}")
include_directories(${LIBLLDB_INCLUDE})
link_directories(${LLDB_LIB_PATH})
## lldb requires C++11
add_definitions(-std=c++11)
set(PLUGIN_NAME "LLDBDebugger")
project(LLDBDebugger)
if ( APPLE )
## Under Apple, we only support monolithic build of wxWidgets
find_package(wxWidgets COMPONENTS std REQUIRED)
else ( APPLE )
find_package(wxWidgets COMPONENTS std aui propgrid stc richtext ribbon REQUIRED)
endif ( APPLE )
# wxWidgets include (this will do all the magic to configure everything)
include( "${wxWidgets_USE_FILE}" )
# Include paths
include_directories("${CL_SRC_ROOT}/Plugin"
"${CL_SRC_ROOT}/CodeLite"
"${CL_SRC_ROOT}/PCH"
"${CL_SRC_ROOT}/Interfaces")
## Definitions
add_definitions(-DWXUSINGDLL_WXSQLITE3)
add_definitions(-DWXUSINGDLL_CL)
add_definitions(-DWXUSINGDLL_SDK)
# Add RPATH
if (UNIX)
set (LINKER_OPTIONS -Wl,-rpath,"${PLUGINS_DIR}")
endif (UNIX)
## By default, use the sources under the current folder
FILE(GLOB PLUGIN_SRCS "*.cpp")
# Define the output - shared library
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SRCS})
target_link_libraries(LLDBDebugger LLDBProtocol)
target_link_libraries(${PLUGIN_NAME} ${LIBLLDB})
# Codelite plugins doesn't use the "lib" prefix.
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${PLUGIN_EXTRA_LIBS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
-lLLDBProtocol
-llibcodelite
-lplugin
-lwxsqlite3-3.0
-lsqlite3
)
# The plugin library is required
add_dependencies(${PLUGIN_NAME} plugin)
# Installation destination
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
if ( LIBLLDB_INSTALL_NEEDED MATCHES 1 )
set(LLDB_LIB_ABS ${LIBLLDB})
if ( IS_SYMLINK ${LIBLLDB} )
message( "-- ${LIBLLDB} is a symbolic link ")
get_filename_component(LLDB_LIB_TMP ${LIBLLDB} REALPATH)
set( LLDB_LIB_ABS ${LLDB_LIB_TMP})
endif()
message("-- Will install file ${LLDB_LIB_ABS}")
install(FILES ${LLDB_LIB_ABS} DESTINATION ${PLUGINS_DIR} PERMISSIONS ${EXE_PERM})
endif()
add_subdirectory(LLDBProtocol)
add_subdirectory(codelite-lldb)
add_dependencies(codelite-lldb LLDBProtocol)
add_dependencies(LLDBDebugger LLDBProtocol)
else()
if (LLDB_OFFICIAL_FOUND MATCHES 0)
message(" **** NOTICE: lldb is not available. You could try installing >= the lldb-3.5-dev (or equivalent) package")
endif()
endif()
endif(WITH_LLDB MATCHES 1)
|