1static_library("Support") {
2  output_name = "LLVMSupport"
3  deps = [
4    "//llvm/include/llvm/Config:config",
5    "//llvm/lib/Demangle",
6    "//llvm/utils/gn/build/libs/pthread",
7    "//llvm/utils/gn/build/libs/terminfo",
8    "//llvm/utils/gn/build/libs/zlib",
9  ]
10
11  # public_deps are used for depending on targets that generate headers
12  # which are included in public headers of this target. public_deps means
13  # that targets depending on Support will implicitly be built only after
14  # abi-breaking and llvm-config have been built.
15  public_deps = [
16    # abi-breaking.h is also include by public headers in ADT, but ADT has
17    # no target in the gn build.  Since everything depends on Support, this
18    # public_dep does double duty of abi-breaking.h uses in public headers of
19    # both Support and ADT.
20    "//llvm/include/llvm/Config:abi-breaking",
21    "//llvm/include/llvm/Config:llvm-config",
22
23    # public_dep because public header TargetSelect.h includes these .def files.
24    "//llvm/include/llvm/Config:write_target_def_files",
25
26    # public_dep because random targets assume its output exists.
27    "//llvm/include/llvm/Support:write_extension_def",
28  ]
29  include_dirs = [
30    "Unix",
31    "Windows",
32  ]
33  sources = [
34    "AArch64TargetParser.cpp",
35    "ABIBreak.cpp",
36    "AMDGPUMetadata.cpp",
37    "APFixedPoint.cpp",
38    "APFloat.cpp",
39    "APInt.cpp",
40    "APSInt.cpp",
41    "ARMAttributeParser.cpp",
42    "ARMBuildAttrs.cpp",
43    "ARMTargetParser.cpp",
44    "ARMWinEH.cpp",
45    "Allocator.cpp",
46    "BinaryStreamError.cpp",
47    "BinaryStreamReader.cpp",
48    "BinaryStreamRef.cpp",
49    "BinaryStreamWriter.cpp",
50    "BlockFrequency.cpp",
51    "BranchProbability.cpp",
52    "BuryPointer.cpp",
53    "COM.cpp",
54    "CRC.cpp",
55    "CachePruning.cpp",
56    "Chrono.cpp",
57    "CodeGenCoverage.cpp",
58    "CommandLine.cpp",
59    "Compression.cpp",
60    "ConvertUTF.cpp",
61    "ConvertUTFWrapper.cpp",
62    "CrashRecoveryContext.cpp",
63    "DAGDeltaAlgorithm.cpp",
64    "DJB.cpp",
65    "DataExtractor.cpp",
66    "Debug.cpp",
67    "DebugCounter.cpp",
68    "DeltaAlgorithm.cpp",
69    "ELFAttributeParser.cpp",
70    "ELFAttributes.cpp",
71    "Error.cpp",
72    "ErrorHandling.cpp",
73    "ExtensibleRTTI.cpp",
74    "FileCollector.cpp",
75    "FileOutputBuffer.cpp",
76    "FileUtilities.cpp",
77    "FoldingSet.cpp",
78    "FormatVariadic.cpp",
79    "FormattedStream.cpp",
80    "GlobPattern.cpp",
81    "GraphWriter.cpp",
82    "Hashing.cpp",
83    "InitLLVM.cpp",
84    "InstructionCost.cpp",
85    "IntEqClasses.cpp",
86    "IntervalMap.cpp",
87    "ItaniumManglingCanonicalizer.cpp",
88    "JSON.cpp",
89    "KnownBits.cpp",
90    "LEB128.cpp",
91    "LineIterator.cpp",
92    "Locale.cpp",
93    "LockFileManager.cpp",
94    "LowLevelType.cpp",
95    "MD5.cpp",
96    "ManagedStatic.cpp",
97    "MathExtras.cpp",
98    "MemAlloc.cpp",
99    "MemoryBuffer.cpp",
100    "MemoryBufferRef.cpp",
101    "NativeFormatting.cpp",
102    "OptimizedStructLayout.cpp",
103    "Optional.cpp",
104    "Parallel.cpp",
105    "PluginLoader.cpp",
106    "PrettyStackTrace.cpp",
107    "RISCVAttributeParser.cpp",
108    "RISCVAttributes.cpp",
109    "RWMutex.cpp",
110    "RandomNumberGenerator.cpp",
111    "Regex.cpp",
112    "SHA1.cpp",
113    "ScaledNumber.cpp",
114    "ScopedPrinter.cpp",
115    "Signposts.cpp",
116    "SmallPtrSet.cpp",
117    "SmallVector.cpp",
118    "SourceMgr.cpp",
119    "SpecialCaseList.cpp",
120    "Statistic.cpp",
121    "StringExtras.cpp",
122    "StringMap.cpp",
123    "StringRef.cpp",
124    "StringSaver.cpp",
125    "SuffixTree.cpp",
126    "SymbolRemappingReader.cpp",
127    "SystemUtils.cpp",
128    "TarWriter.cpp",
129    "TargetParser.cpp",
130    "ThreadPool.cpp",
131    "TimeProfiler.cpp",
132    "Timer.cpp",
133    "ToolOutputFile.cpp",
134    "TrigramIndex.cpp",
135    "Triple.cpp",
136    "Twine.cpp",
137    "Unicode.cpp",
138    "UnicodeCaseFold.cpp",
139    "VersionTuple.cpp",
140    "WithColor.cpp",
141    "X86TargetParser.cpp",
142    "YAMLParser.cpp",
143    "YAMLTraits.cpp",
144    "Z3Solver.cpp",
145    "circular_raw_ostream.cpp",
146    "raw_os_ostream.cpp",
147    "raw_ostream.cpp",
148    "regcomp.c",
149    "regerror.c",
150    "regexec.c",
151    "regfree.c",
152    "regstrlcpy.c",
153    "xxhash.cpp",
154
155    # System
156    "Atomic.cpp",
157    "DynamicLibrary.cpp",
158    "Errno.cpp",
159    "Host.cpp",
160    "Memory.cpp",
161    "Path.cpp",
162    "Process.cpp",
163    "Program.cpp",
164    "Signals.cpp",
165    "TargetRegistry.cpp",
166    "ThreadLocal.cpp",
167    "Threading.cpp",
168    "Valgrind.cpp",
169    "VirtualFileSystem.cpp",
170    "Watchdog.cpp",
171  ]
172
173  libs = []
174
175  # FIXME: llvm/Config/BUILD.gn currently always sets LLVM_WITH_Z3
176  # to false. If that changes we need to link to Z3 libs here.
177
178  if (current_os == "linux" || current_os == "android") {
179    libs += [ "dl" ]
180  } else if (current_os == "win") {
181    # Delay load shell32.dll if possible to speed up process startup.
182    libs += [ "delayimp.lib" ]
183    ldflags = [
184      "-delayload:ole32.dll",
185      "-delayload:shell32.dll",
186    ]
187  }
188}
189