blob: f5ce11d3ffef3e792e2e54a788224eadedd86b4a [file] [log] [blame]
Daniel Maleaaebeefd2013-02-21 20:58:22 +00001include_directories(.)
2
Daniel Malea137c4d72013-02-28 23:11:46 +00003if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
Daniel Maleaaebeefd2013-02-21 20:58:22 +00004include_directories(
5 Plugins/Process/Linux
6 Plugins/Process/POSIX
7 )
Daniel Malea137c4d72013-02-28 23:11:46 +00008endif ()
Daniel Maleaaebeefd2013-02-21 20:58:22 +00009
10add_subdirectory(API)
11add_subdirectory(Breakpoint)
12add_subdirectory(Commands)
13add_subdirectory(Core)
14add_subdirectory(DataFormatters)
15add_subdirectory(Expression)
16add_subdirectory(Host)
17add_subdirectory(Interpreter)
18add_subdirectory(Plugins)
19add_subdirectory(Symbol)
20add_subdirectory(Target)
21add_subdirectory(Utility)
22
23set( LLDB_USED_LIBS
24 lldbAPI
25 lldbBreakpoint
26 lldbCommands
27 lldbDataFormatters
28 lldbHostCommon
29 lldbCore
30 lldbExpression
Daniel Maleaaebeefd2013-02-21 20:58:22 +000031 lldbInterpreter
32 lldbSymbol
33 lldbTarget
34 lldbUtility
35
36 # Plugins
37 lldbPluginDisassemblerLLVM
38 lldbPluginSymbolFileDWARF
39 lldbPluginSymbolFileSymtab
40 lldbPluginDynamicLoaderStatic
41
42 lldbPluginObjectFileMachO
43 lldbPluginObjectFileELF
44 lldbPluginObjectContainerBSDArchive
45 lldbPluginObjectContainerMachOArchive
46 lldbPluginProcessGDBRemote
47 lldbPluginProcessUtility
48 lldbPluginPlatformGDB
49 lldbPluginPlatformFreeBSD
50 lldbPluginPlatformLinux
51 lldbPluginObjectFileMachO
52 lldbPluginObjectContainerMachOArchive
53 lldbPluginObjectContainerBSDArchive
54 lldbPluginPlatformMacOSX
55 lldbPluginDynamicLoaderMacOSXDYLD
56 lldbPluginDynamicLoaderPosixDYLD
57 lldbPluginUnwindAssemblyInstEmulation
58 lldbPluginUnwindAssemblyX86
59 lldbPluginDynamicLoaderDarwinKernel
60 lldbPluginAppleObjCRuntime
61 lldbPluginCXXItaniumABI
62 lldbPluginABIMacOSX_arm
63 lldbPluginABIMacOSX_i386
64 lldbPluginABISysV_x86_64
65 lldbPluginInstructionARM
Daniel Maleaaebeefd2013-02-21 20:58:22 +000066 lldbPluginObjectFilePECOFF
Daniel Malea137c4d72013-02-28 23:11:46 +000067 lldbPluginOSPython
Daniel Maleaaebeefd2013-02-21 20:58:22 +000068 )
Daniel Malea137c4d72013-02-28 23:11:46 +000069
70# Windows-only libraries
71if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
72 list(APPEND LLDB_USED_LIBS
73 #lldbHostWindows
74 #lldbPluginPlatformWindows
75 #Ws2_32
76 )
77endif ()
78
79# Linux-only libraries
80if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
81 list(APPEND LLDB_USED_LIBS
82 lldbHostLinux
83 lldbPluginProcessLinux
84 lldbPluginProcessPOSIX
85 )
86endif ()
87
Daniel Maleaaebeefd2013-02-21 20:58:22 +000088set( CLANG_USED_LIBS
89 clangAnalysis
90 clangAST
91 clangBasic
92 clangCodeGen
93 clangDriver
94 clangEdit
95 clangFrontend
96 clangLex
97 clangParse
98 clangRewriteCore
99 clangRewriteFrontend
100 clangSema
101 clangSerialization
102 )
103
104set( LLDB_SYSTEM_LIBS
105 edit
106 python2.7
107 )
108
109set( LLVM_LINK_COMPONENTS
110 ${LLVM_TARGETS_TO_BUILD}
111 jit
112 interpreter
113 nativecodegen
114 asmparser
115 bitreader
116 bitwriter
117 codegen
118 ipo
119 selectiondag
120 bitreader
121 mc
122 mcjit
123 core
124 mcdisassembler
125 executionengine
126 )
127
Daniel Malea08561072013-03-05 21:59:12 +0000128set_source_files_properties(${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp PROPERTIES GENERATED 1)
Daniel Maleaaebeefd2013-02-21 20:58:22 +0000129set(SHARED_LIBRARY 1)
130
131add_lldb_library(liblldb
132 lldb.cpp
133 lldb-log.cpp
Daniel Malea08561072013-03-05 21:59:12 +0000134 ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp
Daniel Maleaaebeefd2013-02-21 20:58:22 +0000135 )
136set_target_properties(liblldb PROPERTIES OUTPUT_NAME lldb)
Daniel Malea08561072013-03-05 21:59:12 +0000137add_dependencies(liblldb ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
138target_link_libraries(liblldb ${LLDB_SYSTEM_LIBS})
Daniel Malea137c4d72013-02-28 23:11:46 +0000139
140# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as
141# such will not work on Windows.
142if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
143 execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR}
144 OUTPUT_VARIABLE LLDB_REVISION)
Sylvestre Ledru3863dd02013-03-16 17:01:13 +0000145 if ( LLDB_REVISION )
146 string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
147 endif()
Daniel Malea137c4d72013-02-28 23:11:46 +0000148
149 execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR}
150 OUTPUT_VARIABLE LLDB_REPOSITORY)
Sylvestre Ledru3863dd02013-03-16 17:01:13 +0000151 if ( LLDB_REPOSITORY )
152 string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
153 string(REPLACE " " "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
154 endif()
Daniel Malea137c4d72013-02-28 23:11:46 +0000155
156 set_property(
157 SOURCE lldb.cpp
158 PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"")
159endif ()
160# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
161# revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
162
Daniel Maleaaebeefd2013-02-21 20:58:22 +0000163
164install(TARGETS liblldb
165 LIBRARY DESTINATION lib)