[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / source / API / CMakeLists.txt
blobe0ecf29b502b7c98ebe3fd4bfe0897540de39705
1 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
2   add_definitions( -DEXPORT_LIBLLDB )
3 endif()
5 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
7 if(LLDB_ENABLE_PYTHON)
8   get_target_property(lldb_bindings_dir swig_wrapper BINARY_DIR)
9   set(lldb_python_wrapper ${lldb_bindings_dir}/LLDBWrapPython.cpp)
10 endif()
12 if(LLDB_ENABLE_LUA)
13   get_target_property(lldb_bindings_dir swig_wrapper_lua BINARY_DIR)
14   set(lldb_lua_wrapper ${lldb_bindings_dir}/LLDBWrapLua.cpp)
15 endif()
17 if(LLDB_BUILD_FRAMEWORK)
18   set(option_install_prefix INSTALL_PREFIX ${LLDB_FRAMEWORK_INSTALL_DIR})
19   set(option_framework FRAMEWORK)
20 endif()
22 add_lldb_library(liblldb SHARED ${option_framework}
23   SBAddress.cpp
24   SBAttachInfo.cpp
25   SBBlock.cpp
26   SBBreakpoint.cpp
27   SBBreakpointLocation.cpp
28   SBBreakpointName.cpp
29   SBBreakpointOptionCommon.cpp
30   SBBroadcaster.cpp
31   SBCommandInterpreter.cpp
32   SBCommandReturnObject.cpp
33   SBCommunication.cpp
34   SBCompileUnit.cpp
35   SBData.cpp
36   SBDebugger.cpp
37   SBDeclaration.cpp
38   SBError.cpp
39   SBEvent.cpp
40   SBExecutionContext.cpp
41   SBExpressionOptions.cpp
42   SBFileSpec.cpp
43   SBFile.cpp
44   SBFileSpecList.cpp
45   SBFrame.cpp
46   SBFunction.cpp
47   SBHostOS.cpp
48   SBInstruction.cpp
49   SBInstructionList.cpp
50   SBLanguageRuntime.cpp
51   SBLaunchInfo.cpp
52   SBLineEntry.cpp
53   SBListener.cpp
54   SBMemoryRegionInfo.cpp
55   SBMemoryRegionInfoList.cpp
56   SBModule.cpp
57   SBModuleSpec.cpp
58   SBPlatform.cpp
59   SBProcess.cpp
60   SBProcessInfo.cpp
61   SBQueue.cpp
62   SBQueueItem.cpp
63   SBReproducer.cpp
64   SBSection.cpp
65   SBSourceManager.cpp
66   SBStream.cpp
67   SBStringList.cpp
68   SBStructuredData.cpp
69   SBSymbol.cpp
70   SBSymbolContext.cpp
71   SBSymbolContextList.cpp
72   SBTarget.cpp
73   SBThread.cpp
74   SBThreadCollection.cpp
75   SBThreadPlan.cpp
76   SBTrace.cpp
77   SBTraceOptions.cpp
78   SBType.cpp
79   SBTypeCategory.cpp
80   SBTypeEnumMember.cpp
81   SBTypeFilter.cpp
82   SBTypeFormat.cpp
83   SBTypeNameSpecifier.cpp
84   SBTypeSummary.cpp
85   SBTypeSynthetic.cpp
86   SBValue.cpp
87   SBValueList.cpp
88   SBVariablesOptions.cpp
89   SBWatchpoint.cpp
90   SBUnixSignals.cpp
91   SystemInitializerFull.cpp
92   ${lldb_python_wrapper}
93   ${lldb_lua_wrapper}
95   LINK_LIBS
96     lldbBase
97     lldbBreakpoint
98     lldbCore
99     lldbDataFormatters
100     lldbExpression
101     lldbHost
102     lldbInitialization
103     lldbInterpreter
104     lldbSymbol
105     lldbTarget
106     lldbUtility
107     ${LLDB_ALL_PLUGINS}
108   LINK_COMPONENTS
109     Support
111   ${option_install_prefix}
114 # lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
115 # which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
116 # (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
117 # that _lldb.so can be loaded from Python.
118 if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE)
119   set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
120 endif()
122 if (MSVC)
123   set_source_files_properties(SBReproducer.cpp PROPERTIES COMPILE_FLAGS /bigobj)
124 endif()
126 if(lldb_python_wrapper)
127   add_dependencies(liblldb swig_wrapper)
129   if (MSVC)
130     set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
131   else()
132     set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
133   endif()
135   set_source_files_properties(${lldb_python_wrapper} PROPERTIES GENERATED ON)
136   if (CLANG_CL)
137     set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING
138       PROPERTY COMPILE_FLAGS " -Wno-unused-function")
139   endif()
140   if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
141       NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
142     set_property(SOURCE ${lldb_python_wrapper} APPEND_STRING
143       PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual")
144   endif ()
145 endif()
147 if(lldb_lua_wrapper)
148   add_dependencies(liblldb swig_wrapper_lua)
149   target_include_directories(liblldb PRIVATE ${LUA_INCLUDE_DIR})
151   if (MSVC)
152     set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
153   else()
154     set_property(SOURCE ${lldb_lua_wrapper} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
155   endif()
157   set_source_files_properties(${lldb_lua_wrapper} PROPERTIES GENERATED ON)
158 endif()
160 set_target_properties(liblldb
161   PROPERTIES
162   VERSION ${LLDB_VERSION}
165 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
166   if (NOT LLDB_EXPORT_ALL_SYMBOLS)
167     # If we're not exporting all symbols, we'll want to explicitly set
168     # the exported symbols here.  This prevents 'log enable --stack ...'
169     # from working on some systems but limits the liblldb size.
170     MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb namespace")
171     add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
172   else()
173     # Don't use an explicit export.  Instead, tell the linker to
174     # export all symbols.
175     MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
176     add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
177   endif()
178   set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
179 endif()
181 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
182   # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
183   # so only it needs to explicitly link against ${PYTHON_LIBRARIES}
184   if (MSVC AND LLDB_ENABLE_PYTHON)
185     target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARIES})
186   endif()
187 else()
188   set_target_properties(liblldb
189     PROPERTIES
190     OUTPUT_NAME lldb
191   )
192 endif()
194 if (NOT LLDB_BUILT_STANDALONE)
195   add_dependencies(liblldb clang-resource-headers)
196 endif()
198 if(LLDB_BUILD_FRAMEWORK)
199   include(LLDBFramework)
200 endif()