2013-09-25 18:37:32 +08:00
|
|
|
include_directories(.)
|
|
|
|
|
|
|
|
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 ()
|
|
|
|
|
2015-10-24 08:27:04 +08:00
|
|
|
if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
|
|
|
|
include_directories(
|
|
|
|
Plugins/Process/POSIX
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
2015-10-09 11:40:55 +08:00
|
|
|
set(lldbBase_SOURCES
|
|
|
|
lldb.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c)
|
|
|
|
add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE}
|
|
|
|
COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
|
|
|
|
${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core
|
|
|
|
> ${LLDB_VERS_GENERATED_FILE}
|
|
|
|
DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
|
|
|
|
${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj)
|
|
|
|
set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
|
|
|
|
# Add this to lldbBase since lldb.cpp uses the symbol defined here.
|
|
|
|
list(APPEND lldbBase_SOURCES ${LLDB_VERS_GENERATED_FILE})
|
|
|
|
add_custom_target(lldbGeneratedVersion
|
|
|
|
DEPENDS ${LLDB_VERS_GENERATED_FILE})
|
|
|
|
endif()
|
|
|
|
|
2015-03-19 00:56:24 +08:00
|
|
|
add_lldb_library(lldbBase
|
2015-10-09 11:40:55 +08:00
|
|
|
${lldbBase_SOURCES}
|
2015-03-19 00:56:24 +08:00
|
|
|
)
|
|
|
|
|
2015-10-09 11:40:55 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
add_dependencies(lldbBase lldbGeneratedVersion)
|
|
|
|
endif()
|
|
|
|
|
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)
|
2015-03-20 06:00:21 +08:00
|
|
|
add_subdirectory(Initialization)
|
2013-09-25 18:37:32 +08:00
|
|
|
add_subdirectory(Interpreter)
|
|
|
|
add_subdirectory(Plugins)
|
|
|
|
add_subdirectory(Symbol)
|
|
|
|
add_subdirectory(Target)
|
|
|
|
add_subdirectory(Utility)
|
|
|
|
|
2015-03-20 06:00:21 +08:00
|
|
|
# Build API last. Since liblldb needs to link against every other target, it needs
|
|
|
|
# those targets to have already been created.
|
2015-03-19 00:56:24 +08:00
|
|
|
add_subdirectory(API)
|
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.
|