2013-09-25 18:37:32 +08:00
|
|
|
include_directories(.)
|
|
|
|
|
2015-10-09 11:40:55 +08:00
|
|
|
set(lldbBase_SOURCES
|
|
|
|
lldb.cpp
|
|
|
|
)
|
|
|
|
|
2016-09-24 07:33:52 +08:00
|
|
|
foreach(file
|
|
|
|
"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git
|
|
|
|
"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7
|
|
|
|
"${LLDB_SOURCE_DIR}/.svn/entries" # SVN 1.6
|
|
|
|
)
|
|
|
|
if(EXISTS "${file}")
|
|
|
|
set(lldb_vc "${file}")
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(DEFINED lldb_vc)
|
|
|
|
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
|
2016-10-19 20:54:28 +08:00
|
|
|
set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
|
2016-09-24 07:33:52 +08:00
|
|
|
|
|
|
|
# Create custom target to generate the VC revision include.
|
|
|
|
add_custom_command(OUTPUT "${version_inc}"
|
|
|
|
DEPENDS "${lldb_vc}" "${get_svn_script}"
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}"
|
|
|
|
"-DFIRST_NAME=LLDB"
|
|
|
|
"-DHEADER_FILE=${version_inc}"
|
|
|
|
-P "${get_svn_script}")
|
|
|
|
|
|
|
|
# Mark the generated header as being generated.
|
|
|
|
set_source_files_properties("${version_inc}"
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
|
|
|
|
# Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
|
2016-11-11 07:56:32 +08:00
|
|
|
set_property(SOURCE lldb.cpp APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
|
2016-09-24 07:33:52 +08:00
|
|
|
list(APPEND lldbBase_SOURCES ${version_inc})
|
|
|
|
endif()
|
|
|
|
|
2016-11-11 01:33:19 +08:00
|
|
|
if(APPLE)
|
|
|
|
set(apple_version_inc "${CMAKE_CURRENT_BINARY_DIR}/AppleVersion.inc")
|
|
|
|
set(apple_version_script "${LLDB_SOURCE_DIR}/cmake/modules/EmbedAppleVersion.cmake")
|
|
|
|
set(info_plist ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist)
|
|
|
|
|
|
|
|
# Create custom target to generate the VC revision include.
|
|
|
|
add_custom_command(OUTPUT "${apple_version_inc}"
|
|
|
|
DEPENDS "${apple_version_script}" "${info_plist}"
|
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} "-DLLDB_INFO_PLIST=${info_plist}"
|
|
|
|
"-DHEADER_FILE=${apple_version_inc}"
|
|
|
|
-P "${apple_version_script}")
|
|
|
|
|
|
|
|
# Mark the generated header as being generated.
|
|
|
|
set_source_files_properties("${apple_version_inc}"
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
|
|
|
|
# Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
|
2016-11-11 07:56:32 +08:00
|
|
|
set_property(SOURCE lldb.cpp APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS "HAVE_APPLE_VERSION_INC")
|
2016-11-11 01:33:19 +08:00
|
|
|
list(APPEND lldbBase_SOURCES ${apple_version_inc})
|
|
|
|
elseif(LLDB_VERSION_STRING)
|
2016-11-11 07:56:32 +08:00
|
|
|
set_property(SOURCE lldb.cpp APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS "LLDB_VERSION_STRING=${LLDB_VERSION_STRING}")
|
2016-11-11 01:33:19 +08:00
|
|
|
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
|
|
|
)
|
|
|
|
|
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)
|