| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 1 | include_directories(.) |
| 2 | |
| 3 | if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) |
| 4 | include_directories( |
| 5 | Plugins/Process/Linux |
| 6 | Plugins/Process/POSIX |
| 7 | ) |
| 8 | endif () |
| 9 | |
| 10 | if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) |
| 11 | include_directories( |
| 12 | Plugins/Process/FreeBSD |
| 13 | Plugins/Process/POSIX |
| 14 | ) |
| 15 | endif () |
| 16 | |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 17 | # Need to export the API in the liblldb.dll for Windows |
| 18 | # The lldbAPI source files are added directly in liblldb |
| 19 | if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 20 | add_subdirectory(API) |
| 21 | endif () |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 22 | add_subdirectory(Breakpoint) |
| 23 | add_subdirectory(Commands) |
| 24 | add_subdirectory(Core) |
| 25 | add_subdirectory(DataFormatters) |
| 26 | add_subdirectory(Expression) |
| 27 | add_subdirectory(Host) |
| 28 | add_subdirectory(Interpreter) |
| 29 | add_subdirectory(Plugins) |
| 30 | add_subdirectory(Symbol) |
| 31 | add_subdirectory(Target) |
| 32 | add_subdirectory(Utility) |
| 33 | |
| 34 | set( LLDB_USED_LIBS |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 35 | lldbBreakpoint |
| 36 | lldbCommands |
| 37 | lldbDataFormatters |
| Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 38 | lldbHost |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 39 | lldbCore |
| 40 | lldbExpression |
| 41 | lldbInterpreter |
| 42 | lldbSymbol |
| Saleem Abdulrasool | 1239084 | 2014-03-11 03:08:47 +0000 | [diff] [blame] | 43 | lldbTarget |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 44 | lldbUtility |
| Saleem Abdulrasool | 1239084 | 2014-03-11 03:08:47 +0000 | [diff] [blame] | 45 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 46 | # Plugins |
| 47 | lldbPluginDisassemblerLLVM |
| 48 | lldbPluginSymbolFileDWARF |
| 49 | lldbPluginSymbolFileSymtab |
| 50 | lldbPluginDynamicLoaderStatic |
| 51 | lldbPluginDynamicLoaderPosixDYLD |
| Deepak Panickal | 5780657 | 2014-07-21 17:24:05 +0000 | [diff] [blame] | 52 | lldbPluginDynamicLoaderHexagonDYLD |
| Saleem Abdulrasool | 1239084 | 2014-03-11 03:08:47 +0000 | [diff] [blame] | 53 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 54 | lldbPluginObjectFileMachO |
| 55 | lldbPluginObjectFileELF |
| Ed Maste | b9fe0dd | 2014-03-25 02:03:28 +0000 | [diff] [blame] | 56 | lldbPluginObjectFileJIT |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 57 | lldbPluginSymbolVendorELF |
| 58 | lldbPluginObjectContainerBSDArchive |
| 59 | lldbPluginObjectContainerMachOArchive |
| 60 | lldbPluginProcessGDBRemote |
| 61 | lldbPluginProcessMachCore |
| 62 | lldbPluginProcessUtility |
| 63 | lldbPluginPlatformGDB |
| 64 | lldbPluginPlatformFreeBSD |
| Todd Fiala | cfee963 | 2014-07-16 15:03:10 +0000 | [diff] [blame] | 65 | lldbPluginPlatformKalimba |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 66 | lldbPluginPlatformLinux |
| 67 | lldbPluginPlatformPOSIX |
| Deepak Panickal | a0154f9 | 2013-10-15 12:32:12 +0000 | [diff] [blame] | 68 | lldbPluginPlatformWindows |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 69 | lldbPluginObjectFileMachO |
| 70 | lldbPluginObjectContainerMachOArchive |
| 71 | lldbPluginObjectContainerBSDArchive |
| 72 | lldbPluginPlatformMacOSX |
| 73 | lldbPluginDynamicLoaderMacOSXDYLD |
| 74 | lldbPluginUnwindAssemblyInstEmulation |
| 75 | lldbPluginUnwindAssemblyX86 |
| 76 | lldbPluginAppleObjCRuntime |
| 77 | lldbPluginCXXItaniumABI |
| 78 | lldbPluginABIMacOSX_arm |
| Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 79 | lldbPluginABIMacOSX_arm64 |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 80 | lldbPluginABIMacOSX_i386 |
| 81 | lldbPluginABISysV_x86_64 |
| Deepak Panickal | 5780657 | 2014-07-21 17:24:05 +0000 | [diff] [blame] | 82 | lldbPluginABISysV_hexagon |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 83 | lldbPluginInstructionARM |
| Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 84 | lldbPluginInstructionARM64 |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 85 | lldbPluginObjectFilePECOFF |
| 86 | lldbPluginOSPython |
| Kuba Brecka | beed821 | 2014-09-04 01:03:18 +0000 | [diff] [blame] | 87 | lldbPluginMemoryHistoryASan |
| Eric Christopher | e709821 | 2014-10-11 00:38:55 +0000 | [diff] [blame] | 88 | lldbPluginInstrumentationRuntimeAddressSanitizer |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 89 | ) |
| 90 | |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 91 | # Need to export the API in the liblldb.dll for Windows |
| 92 | # The lldbAPI source files are added directly in liblldb |
| 93 | if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 94 | list(APPEND LLDB_USED_LIBS |
| 95 | lldbAPI |
| 96 | ) |
| 97 | endif () |
| 98 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 99 | # Windows-only libraries |
| 100 | if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 101 | list(APPEND LLDB_USED_LIBS |
| Zachary Turner | 35ed132 | 2014-07-28 16:45:18 +0000 | [diff] [blame] | 102 | lldbPluginProcessWindows |
| Virgile Bello | 3e699d4 | 2014-03-12 16:04:29 +0000 | [diff] [blame] | 103 | lldbPluginProcessElfCore |
| 104 | lldbPluginJITLoaderGDB |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 105 | Ws2_32 |
| 106 | ) |
| 107 | endif () |
| 108 | |
| 109 | # Linux-only libraries |
| 110 | if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) |
| 111 | list(APPEND LLDB_USED_LIBS |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 112 | lldbPluginProcessLinux |
| 113 | lldbPluginProcessPOSIX |
| 114 | lldbPluginProcessElfCore |
| Andrew MacPherson | 17220c1 | 2014-03-05 10:12:43 +0000 | [diff] [blame] | 115 | lldbPluginJITLoaderGDB |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 116 | ) |
| 117 | endif () |
| 118 | |
| 119 | # FreeBSD-only libraries |
| 120 | if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) |
| 121 | list(APPEND LLDB_USED_LIBS |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 122 | lldbPluginProcessFreeBSD |
| 123 | lldbPluginProcessPOSIX |
| 124 | lldbPluginProcessElfCore |
| Ed Maste | 32aa12b | 2014-03-05 13:57:24 +0000 | [diff] [blame] | 125 | lldbPluginJITLoaderGDB |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 126 | ) |
| 127 | endif () |
| 128 | |
| 129 | # Darwin-only libraries |
| 130 | if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) |
| 131 | set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) |
| 132 | add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} |
| 133 | COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl |
| Todd Fiala | 5000e28 | 2014-01-18 08:05:32 +0000 | [diff] [blame] | 134 | ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 135 | > ${LLDB_VERS_GENERATED_FILE}) |
| 136 | |
| 137 | set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) |
| 138 | list(APPEND LLDB_USED_LIBS |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 139 | lldbPluginDynamicLoaderDarwinKernel |
| 140 | lldbPluginProcessMacOSXKernel |
| 141 | lldbPluginSymbolVendorMacOSX |
| Jason Molenda | a7b5afa | 2013-11-15 00:17:32 +0000 | [diff] [blame] | 142 | lldbPluginSystemRuntimeMacOSX |
| Todd Fiala | 8a5c5a0 | 2014-03-13 21:16:13 +0000 | [diff] [blame] | 143 | lldbPluginProcessElfCore |
| 144 | lldbPluginJITLoaderGDB |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 145 | ) |
| 146 | endif() |
| 147 | |
| 148 | set( CLANG_USED_LIBS |
| 149 | clangAnalysis |
| 150 | clangAST |
| 151 | clangBasic |
| 152 | clangCodeGen |
| 153 | clangDriver |
| 154 | clangEdit |
| 155 | clangFrontend |
| 156 | clangLex |
| 157 | clangParse |
| Zachary Turner | 0152e73 | 2014-07-16 18:53:18 +0000 | [diff] [blame] | 158 | clangRewrite |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 159 | clangRewriteFrontend |
| 160 | clangSema |
| 161 | clangSerialization |
| Saleem Abdulrasool | 1239084 | 2014-03-11 03:08:47 +0000 | [diff] [blame] | 162 | ) |
| 163 | |
| Sylvestre Ledru | f0f2d58 | 2013-11-15 14:15:10 +0000 | [diff] [blame] | 164 | set(LLDB_SYSTEM_LIBS) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 165 | if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") |
| Todd Fiala | 86dccb3 | 2014-02-26 17:44:00 +0000 | [diff] [blame] | 166 | list(APPEND LLDB_SYSTEM_LIBS edit panel ncurses) |
| Sylvestre Ledru | f0f2d58 | 2013-11-15 14:15:10 +0000 | [diff] [blame] | 167 | endif() |
| Ed Maste | 0121e43 | 2014-02-26 18:21:42 +0000 | [diff] [blame] | 168 | # On FreeBSD backtrace() is provided by libexecinfo, not libc. |
| 169 | if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") |
| 170 | list(APPEND LLDB_SYSTEM_LIBS execinfo) |
| 171 | endif() |
| 172 | |
| Sylvestre Ledru | f0f2d58 | 2013-11-15 14:15:10 +0000 | [diff] [blame] | 173 | if (NOT LLDB_DISABLE_PYTHON) |
| 174 | list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 175 | endif() |
| 176 | |
| Todd Fiala | 8a5c5a0 | 2014-03-13 21:16:13 +0000 | [diff] [blame] | 177 | list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) |
| 178 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 179 | set( LLVM_LINK_COMPONENTS |
| 180 | ${LLVM_TARGETS_TO_BUILD} |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 181 | interpreter |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 182 | asmparser |
| 183 | bitreader |
| 184 | bitwriter |
| 185 | codegen |
| 186 | ipo |
| 187 | selectiondag |
| 188 | bitreader |
| 189 | mc |
| 190 | mcjit |
| 191 | core |
| 192 | mcdisassembler |
| 193 | executionengine |
| Peter Collingbourne | 19676ac | 2013-11-11 04:46:09 +0000 | [diff] [blame] | 194 | option |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 195 | ) |
| 196 | |
| Deepak Panickal | a0154f9 | 2013-10-15 12:32:12 +0000 | [diff] [blame] | 197 | |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 198 | if ( NOT LLDB_DISABLE_PYTHON ) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 199 | set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp) |
| Saleem Abdulrasool | 0fb2f5d | 2014-07-21 18:18:52 +0000 | [diff] [blame] | 200 | |
| 201 | set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1) |
| 202 | if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND |
| 203 | NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") |
| 204 | set_property(SOURCE ${LLDB_WRAP_PYTHON} |
| 205 | APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point") |
| 206 | endif () |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 207 | endif() |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 208 | set(SHARED_LIBRARY 1) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 209 | |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 210 | if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 211 | add_definitions( -DEXPORT_LIBLLDB ) |
| 212 | endif() |
| 213 | |
| 214 | # Need to export the API in the liblldb.dll for Windows |
| 215 | # The lldbAPI source files are added directly in liblldb |
| 216 | if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| Todd Fiala | 5d1b9c73 | 2014-06-24 21:38:31 +0000 | [diff] [blame] | 217 | # On Non-Windows, the corresponding file list is maintained in |
| 218 | # source\API\CMakeLists.txt. When editing this list, do not forget to make a |
| 219 | # corresponding change in that file as well (when appropriate). |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 220 | add_lldb_library(liblldb |
| 221 | lldb.cpp |
| 222 | lldb-log.cpp |
| 223 | API/SBAddress.cpp |
| 224 | API/SBBlock.cpp |
| 225 | API/SBBreakpoint.cpp |
| 226 | API/SBBreakpointLocation.cpp |
| 227 | API/SBBroadcaster.cpp |
| 228 | API/SBCommandInterpreter.cpp |
| 229 | API/SBCommandReturnObject.cpp |
| 230 | API/SBCommunication.cpp |
| 231 | API/SBCompileUnit.cpp |
| 232 | API/SBData.cpp |
| 233 | API/SBDebugger.cpp |
| 234 | API/SBDeclaration.cpp |
| 235 | API/SBError.cpp |
| 236 | API/SBEvent.cpp |
| Jim Ingham | 5346f88 | 2014-10-01 22:26:52 +0000 | [diff] [blame] | 237 | API/SBExecutionContext.cpp |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 238 | API/SBExpressionOptions.cpp |
| 239 | API/SBFileSpec.cpp |
| 240 | API/SBFileSpecList.cpp |
| 241 | API/SBFrame.cpp |
| 242 | API/SBFunction.cpp |
| 243 | API/SBHostOS.cpp |
| 244 | API/SBInstruction.cpp |
| 245 | API/SBInstructionList.cpp |
| 246 | API/SBLineEntry.cpp |
| 247 | API/SBListener.cpp |
| 248 | API/SBModule.cpp |
| 249 | API/SBModuleSpec.cpp |
| 250 | API/SBPlatform.cpp |
| 251 | API/SBProcess.cpp |
| 252 | API/SBQueue.cpp |
| 253 | API/SBQueueItem.cpp |
| 254 | API/SBSection.cpp |
| 255 | API/SBSourceManager.cpp |
| 256 | API/SBStream.cpp |
| 257 | API/SBStringList.cpp |
| 258 | API/SBSymbol.cpp |
| 259 | API/SBSymbolContext.cpp |
| 260 | API/SBSymbolContextList.cpp |
| 261 | API/SBTarget.cpp |
| 262 | API/SBThread.cpp |
| Jim Ingham | 8d81bdf | 2014-09-30 17:11:53 +0000 | [diff] [blame] | 263 | API/SBThreadPlan.cpp |
| Zachary Turner | 40a069a | 2014-09-11 20:26:49 +0000 | [diff] [blame] | 264 | API/SBThreadCollection.cpp |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 265 | API/SBType.cpp |
| 266 | API/SBTypeCategory.cpp |
| Colin Riley | b7fd1bd | 2014-06-03 13:01:18 +0000 | [diff] [blame] | 267 | API/SBTypeEnumMember.cpp |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 268 | API/SBTypeFilter.cpp |
| 269 | API/SBTypeFormat.cpp |
| 270 | API/SBTypeNameSpecifier.cpp |
| 271 | API/SBTypeSummary.cpp |
| 272 | API/SBTypeSynthetic.cpp |
| Todd Fiala | 5d1b9c73 | 2014-06-24 21:38:31 +0000 | [diff] [blame] | 273 | API/SBUnixSignals.cpp |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 274 | API/SBValue.cpp |
| 275 | API/SBValueList.cpp |
| 276 | API/SBWatchpoint.cpp |
| 277 | Host/Windows/getopt/GetOptInc.cpp |
| 278 | ${LLDB_WRAP_PYTHON} |
| 279 | ${LLDB_VERS_GENERATED_FILE} |
| 280 | ) |
| 281 | else () |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 282 | add_lldb_library(liblldb |
| 283 | lldb.cpp |
| 284 | lldb-log.cpp |
| 285 | ${LLDB_WRAP_PYTHON} |
| 286 | ${LLDB_VERS_GENERATED_FILE} |
| 287 | ) |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 288 | endif () |
| 289 | |
| 290 | if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 291 | set_target_properties(liblldb |
| 292 | PROPERTIES |
| 293 | OUTPUT_NAME liblldb |
| 294 | VERSION ${LLDB_VERSION} |
| 295 | ) |
| 296 | else() |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 297 | set_target_properties(liblldb |
| 298 | PROPERTIES |
| 299 | OUTPUT_NAME lldb |
| 300 | VERSION ${LLDB_VERSION} |
| 301 | ) |
| Deepak Panickal | 627f4ae | 2014-03-03 15:50:36 +0000 | [diff] [blame] | 302 | endif() |
| 303 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 304 | if (LLDB_WRAP_PYTHON OR LLDB_VERS_GENERATED_FILE) |
| Zachary Turner | cfe910b | 2014-08-22 20:44:55 +0000 | [diff] [blame] | 305 | add_dependencies(liblldb swig_wrapper) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 306 | endif() |
| Saleem Abdulrasool | e1401eb | 2014-07-20 05:28:55 +0000 | [diff] [blame] | 307 | target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS}) |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 308 | |
| 309 | # Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as |
| 310 | # such will not work on Windows. |
| 311 | if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) |
| 312 | execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR} |
| 313 | OUTPUT_VARIABLE LLDB_REVISION) |
| 314 | if ( LLDB_REVISION ) |
| 315 | string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION}) |
| 316 | endif() |
| 317 | |
| 318 | execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR} |
| 319 | OUTPUT_VARIABLE LLDB_REPOSITORY) |
| 320 | if ( LLDB_REPOSITORY ) |
| 321 | # Replace newline characters with spaces |
| 322 | string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY}) |
| 323 | |
| 324 | # Remove trailing spaces |
| 325 | string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY}) |
| 326 | endif() |
| 327 | |
| 328 | set_property( |
| 329 | SOURCE lldb.cpp |
| 330 | PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"") |
| 331 | endif () |
| 332 | # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only |
| 333 | # revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. |
| 334 | |
| Zachary Turner | 0ab4b48 | 2014-07-10 23:47:42 +0000 | [diff] [blame] | 335 | if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION ) |
| 336 | # Add a Post-Build Event to copy over Python files and create the symlink to liblldb.so for the Python API(hardlink on Windows) |
| 337 | if ( NOT LLDB_DISABLE_PYTHON ) |
| Zachary Turner | 0ab4b48 | 2014-07-10 23:47:42 +0000 | [diff] [blame] | 338 | add_custom_command( TARGET liblldb |
| 339 | POST_BUILD |
| 340 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py |
| Zachary Turner | 05c3088 | 2014-07-18 07:06:13 +0000 | [diff] [blame] | 341 | 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 |
| Zachary Turner | 0ab4b48 | 2014-07-10 23:47:42 +0000 | [diff] [blame] | 342 | COMMENT "Python script sym-linking LLDB Python API") |
| 343 | endif () |
| 344 | endif () |
| 345 | |
| Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 346 | install(TARGETS liblldb |
| 347 | RUNTIME DESTINATION bin |
| Deepak Panickal | a0154f9 | 2013-10-15 12:32:12 +0000 | [diff] [blame] | 348 | LIBRARY DESTINATION lib |
| 349 | ARCHIVE DESTINATION lib) |