xref: /llvm-project/lld/ELF/CMakeLists.txt (revision fe3406e349884e4ef61480dd0607f1e237102c74)
1set(LLVM_TARGET_DEFINITIONS Options.td)
2tablegen(LLVM Options.inc -gen-opt-parser-defs)
3add_public_tablegen_target(ELFOptionsTableGen)
4
5if(LLVM_ENABLE_ZLIB)
6  set(imported_libs ZLIB::ZLIB)
7endif()
8
9if(LLVM_ENABLE_ZSTD)
10  if(TARGET zstd::libzstd_shared AND NOT LLVM_USE_STATIC_ZSTD)
11    set(zstd_target zstd::libzstd_shared)
12  else()
13    set(zstd_target zstd::libzstd_static)
14  endif()
15endif()
16
17if(LLVM_ENABLE_ZSTD)
18  list(APPEND imported_libs ${zstd_target})
19endif()
20
21add_lld_library(lldELF
22  AArch64ErrataFix.cpp
23  Arch/AArch64.cpp
24  Arch/AMDGPU.cpp
25  Arch/ARM.cpp
26  Arch/AVR.cpp
27  Arch/Hexagon.cpp
28  Arch/LoongArch.cpp
29  Arch/Mips.cpp
30  Arch/MipsArchTree.cpp
31  Arch/MSP430.cpp
32  Arch/PPC.cpp
33  Arch/PPC64.cpp
34  Arch/RISCV.cpp
35  Arch/SPARCV9.cpp
36  Arch/SystemZ.cpp
37  Arch/X86.cpp
38  Arch/X86_64.cpp
39  ARMErrataFix.cpp
40  CallGraphSort.cpp
41  DWARF.cpp
42  Driver.cpp
43  DriverUtils.cpp
44  EhFrame.cpp
45  ICF.cpp
46  InputFiles.cpp
47  InputSection.cpp
48  LTO.cpp
49  LinkerScript.cpp
50  MapFile.cpp
51  MarkLive.cpp
52  OutputSections.cpp
53  Relocations.cpp
54  ScriptLexer.cpp
55  ScriptParser.cpp
56  SymbolTable.cpp
57  Symbols.cpp
58  SyntheticSections.cpp
59  Target.cpp
60  Thunks.cpp
61  Writer.cpp
62
63  LINK_COMPONENTS
64  ${LLVM_TARGETS_TO_BUILD}
65  BinaryFormat
66  BitWriter
67  Core
68  DebugInfoDWARF
69  Demangle
70  LTO
71  MC
72  Object
73  Option
74  Passes
75  Support
76  TargetParser
77  TransformUtils
78
79  LINK_LIBS
80  lldCommon
81  ${imported_libs}
82  ${LLVM_PTHREAD_LIB}
83
84  DEPENDS
85  ELFOptionsTableGen
86  intrinsics_gen
87  )
88