blob: 8e9e1fb2278d4e2339b6185b34f513d71b608364 [file] [log] [blame]
Zachary Turner7513e822015-02-17 22:20:20 +00001if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
Zachary Turner030b8cb2015-02-24 22:17:57 +00002 add_definitions( -DEXPORT_LIBLLDB )
Zachary Turner7513e822015-02-17 22:20:20 +00003endif()
4
Zachary Turner799770c2015-03-18 16:56:24 +00005# Include this so that add_lldb_library() has the list of dependencies
6# for liblldb to link against
7include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
8
9add_lldb_library(liblldb SHARED
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000010 SBAddress.cpp
Oleksiy Vyalov71d08b32015-02-16 00:04:19 +000011 SBAttachInfo.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000012 SBBlock.cpp
13 SBBreakpoint.cpp
14 SBBreakpointLocation.cpp
15 SBBroadcaster.cpp
16 SBCommandInterpreter.cpp
17 SBCommandReturnObject.cpp
18 SBCommunication.cpp
19 SBCompileUnit.cpp
20 SBData.cpp
21 SBDebugger.cpp
22 SBDeclaration.cpp
23 SBError.cpp
24 SBEvent.cpp
Chandler Carruthb8a4ecb2014-10-01 21:33:28 +000025 SBExecutionContext.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000026 SBExpressionOptions.cpp
27 SBFileSpec.cpp
28 SBFileSpecList.cpp
29 SBFrame.cpp
30 SBFunction.cpp
31 SBHostOS.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000032 SBInstruction.cpp
33 SBInstructionList.cpp
Ilia K7f836242015-04-28 12:51:16 +000034 SBLanguageRuntime.cpp
Oleksiy Vyalov1ef7b2c2015-02-04 23:19:15 +000035 SBLaunchInfo.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000036 SBLineEntry.cpp
37 SBListener.cpp
Howard Hellyer260368432016-06-23 08:35:37 +000038 SBMemoryRegionInfo.cpp
39 SBMemoryRegionInfoList.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000040 SBModule.cpp
41 SBModuleSpec.cpp
Ed Maste53414042013-11-21 14:38:22 +000042 SBPlatform.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000043 SBProcess.cpp
Jason Molenda5e8dce42013-12-13 00:29:16 +000044 SBQueue.cpp
45 SBQueueItem.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000046 SBSection.cpp
47 SBSourceManager.cpp
48 SBStream.cpp
49 SBStringList.cpp
50 SBSymbol.cpp
51 SBSymbolContext.cpp
52 SBSymbolContextList.cpp
53 SBTarget.cpp
54 SBThread.cpp
Kuba Breckaaaa0b812014-09-06 01:22:55 +000055 SBThreadCollection.cpp
Todd Fiala8a3716b2014-09-30 15:58:56 +000056 SBThreadPlan.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000057 SBType.cpp
58 SBTypeCategory.cpp
Todd Fiala732215f2014-06-02 20:55:29 +000059 SBTypeEnumMember.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000060 SBTypeFilter.cpp
61 SBTypeFormat.cpp
62 SBTypeNameSpecifier.cpp
63 SBTypeSummary.cpp
64 SBTypeSynthetic.cpp
65 SBValue.cpp
66 SBValueList.cpp
Zachary Turner51f96ee2015-02-17 17:55:50 +000067 SBVariablesOptions.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000068 SBWatchpoint.cpp
Todd Fiala802dc4022014-06-23 19:30:49 +000069 SBUnixSignals.cpp
Zachary Turnere6e2bb32015-03-31 21:03:22 +000070 SystemInitializerFull.cpp
Zachary Turner799770c2015-03-18 16:56:24 +000071 ${LLDB_WRAP_PYTHON}
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000072 )
Zachary Turner799770c2015-03-18 16:56:24 +000073
Zachary Turner2c1f46d2015-07-30 20:28:07 +000074# This should not be part of LLDBDependencies.cmake, because we don't
75# want every single library taking a dependency on the script interpreters.
76target_link_libraries(liblldb PRIVATE
77 lldbPluginScriptInterpreterNone
78 lldbPluginScriptInterpreterPython
79 )
80
Zachary Turner799770c2015-03-18 16:56:24 +000081set_target_properties(liblldb
82 PROPERTIES
83 VERSION ${LLDB_VERSION}
84 )
85
Bruce Mitchener3921fc72015-09-04 00:00:41 +000086if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
Todd Fialad6f84062015-10-14 14:52:15 +000087 if (NOT LLDB_EXPORT_ALL_SYMBOLS)
88 # If we're not exporting all symbols, we'll want to explicitly set
89 # the exported symbols here. This prevents 'log enable --stack ...'
90 # from working on some systems but limits the liblldb size.
91 MESSAGE("-- Symbols (liblldb): only exporting liblldb.exports symbols")
92 add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
93 else()
94 # Don't use an explicit export. Instead, tell the linker to
95 # export all symbols.
96 MESSAGE("-- Symbols (liblldb): exporting all symbols")
97 # Darwin linker doesn't need this extra step.
98 if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
99 lldb_append_link_flags(liblldb "-Wl,--export-dynamic")
100 endif()
101 endif()
Bruce Mitchener3921fc72015-09-04 00:00:41 +0000102endif()
103
Zachary Turner799770c2015-03-18 16:56:24 +0000104if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
105 # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
106 # so only it needs to explicitly link against ${PYTHON_LIBRARY}
107 if (MSVC AND NOT LLDB_DISABLE_PYTHON)
108 target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
109 endif()
110else()
111 set_target_properties(liblldb
112 PROPERTIES
113 OUTPUT_NAME lldb
114 )
115endif()
116
Bruce Mitchener6ec5d612015-10-09 03:40:55 +0000117if (LLDB_WRAP_PYTHON)
Zachary Turner799770c2015-03-18 16:56:24 +0000118 add_dependencies(liblldb swig_wrapper)
119endif()
Pavel Labath2f430a12016-08-17 11:55:50 +0000120target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS})
Zachary Turner799770c2015-03-18 16:56:24 +0000121