2013-09-25 18:37:32 +08:00
|
|
|
include_directories(.)
|
|
|
|
|
2014-11-18 05:31:18 +08:00
|
|
|
if (__ANDROID_NDK__ OR (CMAKE_SYSTEM_NAME MATCHES "Windows"))
|
|
|
|
set(LLDB_DEFAULT_DISABLE_LIBEDIT 1)
|
|
|
|
else()
|
|
|
|
set(LLDB_DEFAULT_DISABLE_LIBEDIT 0)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.")
|
|
|
|
if (LLDB_DISABLE_LIBEDIT)
|
|
|
|
add_definitions( -DLLDB_DISABLE_LIBEDIT )
|
|
|
|
endif()
|
|
|
|
|
2013-09-25 18:37:32 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
|
|
|
|
include_directories(
|
|
|
|
Plugins/Process/Linux
|
|
|
|
Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
|
|
|
|
include_directories(
|
|
|
|
Plugins/Process/FreeBSD
|
|
|
|
Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2014-03-03 23:50:36 +08:00
|
|
|
# Need to export the API in the liblldb.dll for Windows
|
|
|
|
# The lldbAPI source files are added directly in liblldb
|
|
|
|
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
|
|
add_subdirectory(API)
|
|
|
|
endif ()
|
2015-01-15 05:01:15 +08:00
|
|
|
|
2013-09-25 18:37:32 +08:00
|
|
|
add_subdirectory(Breakpoint)
|
|
|
|
add_subdirectory(Commands)
|
|
|
|
add_subdirectory(Core)
|
|
|
|
add_subdirectory(DataFormatters)
|
|
|
|
add_subdirectory(Expression)
|
|
|
|
add_subdirectory(Host)
|
|
|
|
add_subdirectory(Interpreter)
|
|
|
|
add_subdirectory(Plugins)
|
|
|
|
add_subdirectory(Symbol)
|
|
|
|
add_subdirectory(Target)
|
|
|
|
add_subdirectory(Utility)
|
|
|
|
|
2014-11-08 09:41:49 +08:00
|
|
|
include(../cmake/LLDBDependencies.cmake)
|
2014-03-11 11:08:47 +08:00
|
|
|
|
2014-03-03 23:50:36 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
|
|
add_definitions( -DEXPORT_LIBLLDB )
|
2013-09-25 18:37:32 +08:00
|
|
|
endif()
|
|
|
|
|
2014-03-03 23:50:36 +08:00
|
|
|
# Need to export the API in the liblldb.dll for Windows
|
|
|
|
# The lldbAPI source files are added directly in liblldb
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
2014-06-25 05:38:31 +08:00
|
|
|
# On Non-Windows, the corresponding file list is maintained in
|
|
|
|
# source\API\CMakeLists.txt. When editing this list, do not forget to make a
|
|
|
|
# corresponding change in that file as well (when appropriate).
|
2015-01-15 05:01:15 +08:00
|
|
|
add_lldb_library(liblldb SHARED
|
2014-03-03 23:50:36 +08:00
|
|
|
lldb.cpp
|
|
|
|
lldb-log.cpp
|
|
|
|
API/SBAddress.cpp
|
2015-02-16 08:04:19 +08:00
|
|
|
API/SBAttachInfo.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBBlock.cpp
|
|
|
|
API/SBBreakpoint.cpp
|
|
|
|
API/SBBreakpointLocation.cpp
|
|
|
|
API/SBBroadcaster.cpp
|
|
|
|
API/SBCommandInterpreter.cpp
|
|
|
|
API/SBCommandReturnObject.cpp
|
|
|
|
API/SBCommunication.cpp
|
|
|
|
API/SBCompileUnit.cpp
|
|
|
|
API/SBData.cpp
|
|
|
|
API/SBDebugger.cpp
|
|
|
|
API/SBDeclaration.cpp
|
|
|
|
API/SBError.cpp
|
|
|
|
API/SBEvent.cpp
|
2014-10-02 06:26:52 +08:00
|
|
|
API/SBExecutionContext.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBExpressionOptions.cpp
|
|
|
|
API/SBFileSpec.cpp
|
|
|
|
API/SBFileSpecList.cpp
|
|
|
|
API/SBFrame.cpp
|
|
|
|
API/SBFunction.cpp
|
|
|
|
API/SBHostOS.cpp
|
|
|
|
API/SBInstruction.cpp
|
|
|
|
API/SBInstructionList.cpp
|
2015-02-05 07:19:15 +08:00
|
|
|
API/SBLaunchInfo.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBLineEntry.cpp
|
|
|
|
API/SBListener.cpp
|
|
|
|
API/SBModule.cpp
|
|
|
|
API/SBModuleSpec.cpp
|
|
|
|
API/SBPlatform.cpp
|
|
|
|
API/SBProcess.cpp
|
|
|
|
API/SBQueue.cpp
|
|
|
|
API/SBQueueItem.cpp
|
|
|
|
API/SBSection.cpp
|
|
|
|
API/SBSourceManager.cpp
|
|
|
|
API/SBStream.cpp
|
|
|
|
API/SBStringList.cpp
|
|
|
|
API/SBSymbol.cpp
|
|
|
|
API/SBSymbolContext.cpp
|
|
|
|
API/SBSymbolContextList.cpp
|
|
|
|
API/SBTarget.cpp
|
|
|
|
API/SBThread.cpp
|
2014-10-01 01:11:53 +08:00
|
|
|
API/SBThreadPlan.cpp
|
2014-09-12 04:26:49 +08:00
|
|
|
API/SBThreadCollection.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBType.cpp
|
|
|
|
API/SBTypeCategory.cpp
|
2014-06-03 21:01:18 +08:00
|
|
|
API/SBTypeEnumMember.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBTypeFilter.cpp
|
|
|
|
API/SBTypeFormat.cpp
|
|
|
|
API/SBTypeNameSpecifier.cpp
|
|
|
|
API/SBTypeSummary.cpp
|
|
|
|
API/SBTypeSynthetic.cpp
|
2014-06-25 05:38:31 +08:00
|
|
|
API/SBUnixSignals.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBValue.cpp
|
|
|
|
API/SBValueList.cpp
|
2015-02-18 01:55:50 +08:00
|
|
|
API/SBVariablesOptions.cpp
|
2014-03-03 23:50:36 +08:00
|
|
|
API/SBWatchpoint.cpp
|
|
|
|
Host/Windows/getopt/GetOptInc.cpp
|
|
|
|
${LLDB_WRAP_PYTHON}
|
|
|
|
${LLDB_VERS_GENERATED_FILE}
|
|
|
|
)
|
|
|
|
else ()
|
2015-01-16 04:08:35 +08:00
|
|
|
add_lldb_library(liblldb SHARED
|
2013-09-25 18:37:32 +08:00
|
|
|
lldb.cpp
|
|
|
|
lldb-log.cpp
|
|
|
|
${LLDB_WRAP_PYTHON}
|
|
|
|
${LLDB_VERS_GENERATED_FILE}
|
|
|
|
)
|
2014-03-03 23:50:36 +08:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
|
|
set_target_properties(liblldb
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME liblldb
|
|
|
|
VERSION ${LLDB_VERSION}
|
|
|
|
)
|
|
|
|
else()
|
2013-09-25 18:37:32 +08:00
|
|
|
set_target_properties(liblldb
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME lldb
|
|
|
|
VERSION ${LLDB_VERSION}
|
|
|
|
)
|
2014-03-03 23:50:36 +08:00
|
|
|
endif()
|
|
|
|
|
2013-09-25 18:37:32 +08:00
|
|
|
if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE)
|
2014-08-23 04:44:55 +08:00
|
|
|
add_dependencies(liblldb swig_wrapper)
|
2013-09-25 18:37:32 +08:00
|
|
|
endif()
|
2014-07-20 13:28:55 +08:00
|
|
|
target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
|
2013-09-25 18:37:32 +08:00
|
|
|
|
|
|
|
# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as
|
|
|
|
# such will not work on Windows.
|
|
|
|
if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|
|
|
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE LLDB_REVISION)
|
|
|
|
if ( LLDB_REVISION )
|
|
|
|
string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE LLDB_REPOSITORY)
|
|
|
|
if ( LLDB_REPOSITORY )
|
|
|
|
# Replace newline characters with spaces
|
|
|
|
string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY})
|
|
|
|
|
|
|
|
# Remove trailing spaces
|
|
|
|
string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_property(
|
|
|
|
SOURCE lldb.cpp
|
|
|
|
PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"")
|
|
|
|
endif ()
|
|
|
|
# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
|
|
|
|
# revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
|
|
|
|
|
2014-07-11 07:47:42 +08:00
|
|
|
if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )
|
|
|
|
# Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows)
|
|
|
|
if ( NOT LLDB_DISABLE_PYTHON )
|
|
|
|
add_custom_command( TARGET liblldb
|
|
|
|
POST_BUILD
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py
|
2014-07-18 15:06:13 +08:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py --buildConfig=${CMAKE_BUILD_TYPE} "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m
|
2014-07-11 07:47:42 +08:00
|
|
|
COMMENT "Python script sym-linking LLDB Python API")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
2013-09-25 18:37:32 +08:00
|
|
|
install(TARGETS liblldb
|
|
|
|
RUNTIME DESTINATION bin
|
[cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX
variable (now provided both by the normal parent LLVM CMake files and by
the LLVMConfig.cmake file used by the standalone build).
This allows LLDB to build into and install into correctly suffixed
libdirs. This is especially significant for LLDB because the python
extension building done by CMake directly uses multilib suffixes when
the host OS does, and the host OS will not always look back and forth
between them. As a consequence, before LLVM, Clang, and LLDB (and every
other subproject) had support for using LLVM_LIBDIR_SUFFIX, you couldn't
build or install LLDB on a multilib system with its python extensions
enabled. With this patch (on top of all the others I have submitted
throughout the project), I'm finally able to build and install LLDB on
my system with Python support enabled. I'm also able to actually run the
LLDB test suite, etc. Now, a *huge* number of the tests still fail on my
Linux system, but hey, actually running them and them testing the
debugger is a huge step forward. =D
llvm-svn: 224930
2014-12-29 20:42:33 +08:00
|
|
|
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
|
|
|
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|