Skip to content

[CMake] Move common target dependencies into ${TARGET_LIBRARIES} #141271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions llvm/lib/Target/AArch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,9 @@ add_llvm_target(AArch64CodeGen
AArch64Desc
AArch64Info
AArch64Utils
Analysis
AsmPrinter
${TARGET_LIBRARIES}
CFGuard
CodeGen
CodeGenTypes
Core
GlobalISel
MC
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
Vectorize

ADD_TO_COMPONENT
Expand Down
15 changes: 1 addition & 14 deletions llvm/lib/Target/AMDGPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,26 +185,13 @@ add_llvm_target(AMDGPUCodeGen
AMDGPUDesc
AMDGPUInfo
AMDGPUUtils
Analysis
AsmPrinter
${TARGET_LIBRARIES}
BinaryFormat
CodeGen
CodeGenTypes
Core
GlobalISel
HipStdPar
IPO
IRPrinter
Instrumentation
MC
MIRParser
Passes
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
Vectorize

ADD_TO_COMPONENT
Expand Down
12 changes: 1 addition & 11 deletions llvm/lib/Target/ARC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,7 @@ add_llvm_target(ARCCodeGen
LINK_COMPONENTS
ARCDesc
ARCInfo
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
MC
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
ARC
Expand Down
14 changes: 1 addition & 13 deletions llvm/lib/Target/ARM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,9 @@ add_llvm_target(ARMCodeGen
ARMDesc
ARMInfo
ARMUtils
Analysis
AsmPrinter
${TARGET_LIBRARIES}
CFGuard
CodeGen
CodeGenTypes
Core
GlobalISel
IPO
MC
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils

ADD_TO_COMPONENT
ARM
Expand Down
9 changes: 1 addition & 8 deletions llvm/lib/Target/AVR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ add_llvm_target(AVRCodeGen
LINK_COMPONENTS
AVRDesc
AVRInfo
AsmPrinter
CodeGen
CodeGenTypes
Core
MC
SelectionDAG
Support
Target
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
AVR
Expand Down
14 changes: 1 addition & 13 deletions llvm/lib/Target/BPF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,11 @@ add_llvm_target(BPFCodeGen
BTFDebug.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
BPFDesc
BPFInfo
CodeGen
CodeGenTypes
Core
${TARGET_LIBRARIES}
GlobalISel
IPO
MC
Passes
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils

ADD_TO_COMPONENT
BPF
Expand Down
16 changes: 16 additions & 0 deletions llvm/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ add_llvm_component_library(LLVMTarget
TargetParser
)

set(TARGET_LIBRARIES
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
Instrumentation
IPO
MC
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils)

# When building shared objects for each target there are some internal APIs
# that are used across shared objects which we can't hide.
if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND
Expand Down
10 changes: 1 addition & 9 deletions llvm/lib/Target/CSKY/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ add_llvm_target(CSKYCodeGen
CSKYTargetObjectFile.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CSKYDesc
CSKYInfo
CodeGen
CodeGenTypes
Core
MC
SelectionDAG
Support
Target
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
CSKY
Expand Down
13 changes: 1 addition & 12 deletions llvm/lib/Target/DirectX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,12 @@ add_llvm_target(DirectXCodeGen
DXILLegalizePass.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
DXILBitWriter
DirectXDesc
DirectXInfo
DirectXPointerTypeAnalysis
FrontendHLSL
MC
ScalarOpts
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
DirectX
Expand Down
14 changes: 1 addition & 13 deletions llvm/lib/Target/Hexagon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,10 @@ add_llvm_target(HexagonCodeGen
RDFDeadCode.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
HexagonAsmParser
HexagonDesc
HexagonInfo
IPO
MC
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
Hexagon
Expand Down
12 changes: 1 addition & 11 deletions llvm/lib/Target/Lanai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,10 @@ add_llvm_target(LanaiCodeGen
LanaiTargetObjectFile.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
LanaiAsmParser
LanaiDesc
LanaiInfo
MC
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
Lanai
Expand Down
13 changes: 1 addition & 12 deletions llvm/lib/Target/LoongArch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,9 @@ add_llvm_target(LoongArchCodeGen
LoongArchTargetTransformInfo.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
LoongArchDesc
LoongArchInfo
MC
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
LoongArch
Expand Down
12 changes: 2 additions & 10 deletions llvm/lib/Target/M68k/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,10 @@ add_llvm_target(M68kCodeGen
M68kTargetObjectFile.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
GlobalISel
M68kDesc
M68kInfo
MC
SelectionDAG
Support
Target
${TARGET_LIBRARIES}
GlobalISel

ADD_TO_COMPONENT
M68k
Expand Down
9 changes: 1 addition & 8 deletions llvm/lib/Target/MSP430/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ add_llvm_target(MSP430CodeGen
MSP430MCInstLower.cpp

LINK_COMPONENTS
AsmPrinter
CodeGen
CodeGenTypes
Core
MC
MSP430Desc
MSP430Info
SelectionDAG
Support
Target
${TARGET_LIBRARIES}

ADD_TO_COMPONENT
MSP430
Expand Down
14 changes: 2 additions & 12 deletions llvm/lib/Target/Mips/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,10 @@ add_llvm_target(MipsCodeGen
MipsMulMulBugPass.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
GlobalISel
MC
MipsDesc
MipsInfo
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}
GlobalISel

ADD_TO_COMPONENT
Mips
Expand Down
14 changes: 1 addition & 13 deletions llvm/lib/Target/NVPTX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,9 @@ add_llvm_target(NVPTXCodeGen
${NVPTXCodeGen_sources}

LINK_COMPONENTS
Analysis
AsmPrinter
CodeGen
CodeGenTypes
Core
IPO
MC
NVPTXDesc
NVPTXInfo
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}
Vectorize

ADD_TO_COMPONENT
Expand Down
17 changes: 3 additions & 14 deletions llvm/lib/Target/PowerPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,11 @@ add_llvm_target(PowerPCCodeGen
GISel/PPCLegalizerInfo.cpp

LINK_COMPONENTS
Analysis
AsmPrinter
BinaryFormat
CodeGen
CodeGenTypes
Core
GlobalISel
MC
PowerPCDesc
PowerPCInfo
Scalar
SelectionDAG
Support
Target
TargetParser
TransformUtils
${TARGET_LIBRARIES}
BinaryFormat
GlobalISel

ADD_TO_COMPONENT
PowerPC
Expand Down
Loading