blob: 06a26e17c92982caad0dc7779e4608a3fddc6186 [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
38 SBModule.cpp
39 SBModuleSpec.cpp
Ed Maste53414042013-11-21 14:38:22 +000040 SBPlatform.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000041 SBProcess.cpp
Jason Molenda5e8dce42013-12-13 00:29:16 +000042 SBQueue.cpp
43 SBQueueItem.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000044 SBSection.cpp
45 SBSourceManager.cpp
46 SBStream.cpp
47 SBStringList.cpp
48 SBSymbol.cpp
49 SBSymbolContext.cpp
50 SBSymbolContextList.cpp
51 SBTarget.cpp
52 SBThread.cpp
Kuba Breckaaaa0b812014-09-06 01:22:55 +000053 SBThreadCollection.cpp
Todd Fiala8a3716b2014-09-30 15:58:56 +000054 SBThreadPlan.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000055 SBType.cpp
56 SBTypeCategory.cpp
Todd Fiala732215f2014-06-02 20:55:29 +000057 SBTypeEnumMember.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000058 SBTypeFilter.cpp
59 SBTypeFormat.cpp
60 SBTypeNameSpecifier.cpp
61 SBTypeSummary.cpp
62 SBTypeSynthetic.cpp
63 SBValue.cpp
64 SBValueList.cpp
Zachary Turner51f96ee2015-02-17 17:55:50 +000065 SBVariablesOptions.cpp
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000066 SBWatchpoint.cpp
Todd Fiala802dc4022014-06-23 19:30:49 +000067 SBUnixSignals.cpp
Zachary Turnere6e2bb32015-03-31 21:03:22 +000068 SystemInitializerFull.cpp
Zachary Turner799770c2015-03-18 16:56:24 +000069 ${LLDB_WRAP_PYTHON}
Joerg Sonnenberger340a1752013-09-25 10:37:32 +000070 )
Zachary Turner799770c2015-03-18 16:56:24 +000071
Zachary Turner2c1f46d2015-07-30 20:28:07 +000072# This should not be part of LLDBDependencies.cmake, because we don't
73# want every single library taking a dependency on the script interpreters.
74target_link_libraries(liblldb PRIVATE
75 lldbPluginScriptInterpreterNone
76 lldbPluginScriptInterpreterPython
77 )
78
Zachary Turner799770c2015-03-18 16:56:24 +000079set_target_properties(liblldb
80 PROPERTIES
81 VERSION ${LLDB_VERSION}
82 )
83
Bruce Mitchener3921fc72015-09-04 00:00:41 +000084if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
Todd Fialad6f84062015-10-14 14:52:15 +000085 if (NOT LLDB_EXPORT_ALL_SYMBOLS)
86 # If we're not exporting all symbols, we'll want to explicitly set
87 # the exported symbols here. This prevents 'log enable --stack ...'
88 # from working on some systems but limits the liblldb size.
89 MESSAGE("-- Symbols (liblldb): only exporting liblldb.exports symbols")
90 add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
91 else()
92 # Don't use an explicit export. Instead, tell the linker to
93 # export all symbols.
94 MESSAGE("-- Symbols (liblldb): exporting all symbols")
95 # Darwin linker doesn't need this extra step.
96 if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
97 lldb_append_link_flags(liblldb "-Wl,--export-dynamic")
98 endif()
99 endif()
Bruce Mitchener3921fc72015-09-04 00:00:41 +0000100endif()
101
Zachary Turner799770c2015-03-18 16:56:24 +0000102if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
103 # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
104 # so only it needs to explicitly link against ${PYTHON_LIBRARY}
105 if (MSVC AND NOT LLDB_DISABLE_PYTHON)
106 target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
107 endif()
108else()
109 set_target_properties(liblldb
110 PROPERTIES
111 OUTPUT_NAME lldb
112 )
113endif()
114
Bruce Mitchener6ec5d612015-10-09 03:40:55 +0000115if (LLDB_WRAP_PYTHON)
Zachary Turner799770c2015-03-18 16:56:24 +0000116 add_dependencies(liblldb swig_wrapper)
117endif()
118target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
119