[NFC][Py Reformat] Reformat python files in llvm
[llvm-project.git] / llvm / utils / gn / secondary / lldb / source / Plugins / BUILD.gn
blob4c085bf7b622ab47047860ba412d66d96e6ceefc
1 import("//llvm/lib/Target/targets.gni")
2 import("//llvm/utils/gn/build/write_cmake_config.gni")
4 # In the CMake build, each plugin calls `add_lldb_library(name PLUGIN ...)`,
5 # which implicitly adds the plugin name to the LLDB_PLUGINS list.
6 # A few places then query that list and add dependencies on it.
7 # lldb/source/Plugins/CMakeList.txt then does string munging on the list of
8 # plugin names to generate Plugins.def.
9 # In the GN build, we instead have an explicit list of all plugins here.
10 # Every entry in this list is a (GN target, LLDB_PLUGIN Plugins.def name) pair.
11 lldb_plugins = []
12 if (llvm_build_X86) {
13   lldb_plugins += [ [
14         "//lldb/source/Plugins/ABI/X86",
15         "ABIX86",
16       ] ]
18 lldb_plugins += [
19   [
20     "//lldb/source/Plugins/Architecture/PPC64",
21     "ArchitecturePPC64",
22   ],
23   [
24     "//lldb/source/Plugins/Disassembler/LLVMC",
25     "DisassemblerLLVMC",
26   ],
27   [
28     "//lldb/source/Plugins/DynamicLoader/Darwin-Kernel",
29     "DynamicLoaderDarwinKernel",
30   ],
31   [
32     "//lldb/source/Plugins/DynamicLoader/MacOSX-DYLD",
33     "DynamicLoaderMacOSXDYLD",
34   ],
35   [
36     "//lldb/source/Plugins/DynamicLoader/POSIX-DYLD",
37     "DynamicLoaderPosixDYLD",
38   ],
39   [
40     "//lldb/source/Plugins/DynamicLoader/Static",
41     "DynamicLoaderStatic",
42   ],
43   [
44     "//lldb/source/Plugins/DynamicLoader/Windows-DYLD",
45     "DynamicLoaderWindowsDYLD",
46   ],
47   [
48     "//lldb/source/Plugins/Instruction/ARM",
49     "InstructionARM",
50   ],
51   [
52     "//lldb/source/Plugins/JITLoader/GDB",
53     "JITLoaderGDB",
54   ],
55   [
56     "//lldb/source/Plugins/Language/CPlusPlus",
57     "CPlusPlusLanguage",
58   ],
59   [
60     "//lldb/source/Plugins/Language/ObjC",
61     "ObjCLanguage",
62   ],
63   [
64     "//lldb/source/Plugins/Language/ObjCPlusPlus",
65     "ObjCPlusPlusLanguage",
66   ],
67   [
68     "//lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI",
69     "CXXItaniumABI",
70   ],
71   [
72     "//lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime",
73     "AppleObjCRuntime",
74   ],
75   [
76     "//lldb/source/Plugins/ObjectContainer/BSD-Archive",
77     "ObjectContainerBSDArchive",
78   ],
79   [
80     "//lldb/source/Plugins/ObjectContainer/Universal-Mach-O",
81     "ObjectContainerMachOArchive",
82   ],
83   [
84     "//lldb/source/Plugins/ObjectFile/Breakpad",
85     "ObjectFileBreakpad",
86   ],
87   [
88     "//lldb/source/Plugins/ObjectFile/ELF",
89     "ObjectFileELF",
90   ],
91   [
92     "//lldb/source/Plugins/ObjectFile/Mach-O",
93     "ObjectFileMachO",
94   ],
95   [
96     "//lldb/source/Plugins/ObjectFile/PDB",
97     "ObjectFilePDB",
98   ],
99   [
100     "//lldb/source/Plugins/ObjectFile/PECOFF",
101     "ObjectFilePECOFF",
102   ],
103   [
104     "//lldb/source/Plugins/ObjectFile/Placeholder",
105     "ObjectFilePlaceholder",
106   ],
107   [
108     "//lldb/source/Plugins/ObjectFile/wasm",
109     "ObjectFileWasm",
110   ],
111   [
112     "//lldb/source/Plugins/Platform/Linux",
113     "PlatformLinux",
114   ],
115   [
116     "//lldb/source/Plugins/Platform/MacOSX",
117     "PlatformMacOSX",
118   ],
119   [
120     "//lldb/source/Plugins/Platform/Windows",
121     "PlatformWindows",
122   ],
123   [
124     "//lldb/source/Plugins/Process/elf-core",
125     "ProcessElfCore",
126   ],
127   [
128     "//lldb/source/Plugins/Process/gdb-remote",
129     "",  # Uses LLDB_PROCESS_GDB_PLUGIN instead.
130   ],
131   [
132     "//lldb/source/Plugins/Process/mach-core",
133     "ProcessMachCore",
134   ],
135   [
136     "//lldb/source/Plugins/Process/minidump",
137     "ProcessMinidump",
138   ],
139   [
140     "//lldb/source/Plugins/REPL/Clang",
141     "ClangREPL",
142   ],
143   [
144     "//lldb/source/Plugins/ScriptInterpreter/None",
145     "",  # Uses LLDB_SCRIPT_PLUGIN instead.
146   ],
147   [
148     "//lldb/source/Plugins/SymbolFile/Breakpad",
149     "SymbolFileBreakpad",
150   ],
151   [
152     "//lldb/source/Plugins/SymbolFile/DWARF",
153     "SymbolFileDWARF",
154   ],
155   [
156     "//lldb/source/Plugins/SymbolFile/PDB",
157     "SymbolFilePDB",
158   ],
159   [
160     "//lldb/source/Plugins/SymbolFile/Symtab",
161     "SymbolFileSymtab",
162   ],
164 if (current_os == "mac") {
165   lldb_plugins += [ [
166         "//lldb/source/Plugins/SymbolVendor/MacOSX",
167         "SymbolVendorMacOSX",
168       ] ]
170 lldb_plugins += [
171   [
172     "//lldb/source/Plugins/SymbolVendor/ELF",
173     "SymbolVendorELF",
174   ],
176   [
177     "//lldb/source/Plugins/SymbolVendor/wasm",
178     "SymbolVendorWasm",
179   ],
181   [
182     "//lldb/source/Plugins/SymbolVendor/PECOFF",
183     "SymbolVendorPECOFF",
184   ],
186   [
187     "//lldb/source/Plugins/TypeSystem/Clang",
188     "TypeSystemClang",
189   ],
191   [
192     "//lldb/source/Plugins/UnwindAssembly/InstEmulation",
193     "UnwindAssemblyInstEmulation",
194   ],
195   [
196     "//lldb/source/Plugins/UnwindAssembly/x86",
197     "UnwindAssemblyX86",
198   ],
201 write_cmake_config("Plugins.def") {
202   input = "Plugins.def.in"
203   output = "$target_gen_dir/Plugins.def"
205   enum_plugins = ""
206   foreach(plugin, lldb_plugins) {
207     plugin_id = plugin[1]
208     if (plugin_id != "") {
209       # \n is a literal '\' followed by a literal 'n', not a newline character.
210       # write_cmake_config.py replaces it with a real newline.
211       enum_plugins += "LLDB_PLUGIN(" + plugin_id + ")\n"
212     }
213   }
215   deps = [ "//lldb/source/Plugins/ScriptInterpreter/None" ]
216   enum_plugins += "LLDB_SCRIPT_PLUGIN(ScriptInterpreterNone)"
218   values = [ "LLDB_ENUM_PLUGINS=" + enum_plugins ]
220   # These are in separate variables to make sure ProcessWindowsCommon is
221   # initalized after all plugins, but before ProcessGDBRemote.
222   if (current_os == "win") {
223     values +=
224         [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(ProcessWindowsCommon)" ]
225   } else {
226     values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=" ]
227   }
228   values += [ "LLDB_PROCESS_GDB_PLUGIN=LLDB_PLUGIN(ProcessGDBRemote)" ]
231 config("AllLldbPlugins_config") {
232   visibility = [ ":LldbAllPlugins" ]
234   # To pick up Plugins.def.
235   include_dirs = [ "$root_gen_dir/lldb/source" ]
238 group("LldbAllPlugins") {
239   deps = [ ":Plugins.def" ]
240   foreach(plugin, lldb_plugins) {
241     deps += [ plugin[0] ]
242   }
243   public_configs = [ ":AllLldbPlugins_config" ]