1 import("//llvm/lib/Target/targets.gni")
2 import("//llvm/lib/Target/targets_with_asm_parsers.gni")
3 import("//llvm/lib/Target/targets_with_disassemblers.gni")
5 # This build file has two parts:
6 # 1. The actual //llvm/lib/Target build target, which is just a static
7 # library containing the cpp files in this directory. It contains general
9 # 2. Forwarding targets that forward to the concrete targets (X86, ARM, ...).
10 # These are defined in subdirectories, and the forwarding names match
11 # the names of the forwarding targets in CMake. They all (indirectly,
12 # through CodeGen) depend on the //llvm/lib/Target build target.
13 # (See also `gn help labels`).
14 # The dependency chain is:
15 # //llvm/lib/Target:TargetsToBuild (a target in this file) ->
16 # /llvm/lib/Target/(X86|ARM|...) (in the subdirectories) ->
17 # //llvm/lib/CodeGen ->
18 # //llvm/lib/Target (a target in this file again)
19 # Note that while this file appears twice in that stack, it's with different
20 # targets in this file, so there's no cyclic dependency.
22 # 1. Actual build target.
23 static_library("Target") {
24 output_name = "LLVMTarget"
26 "//llvm/lib/Analysis",
32 # This is a bit of a hack: llvm-c/Target.h includes llvm/Config/Targets.def,
33 # but there's no target corresponding to llvm-c. Since the functions
34 # declared in llvm-c/Target.h are defined in llvm/lib/Target, clients of
35 # it must depend on llvm/lib/Target, so add the public_dep for Targets.def
37 "//llvm/include/llvm/Config:write_target_def_files",
41 "TargetIntrinsicInfo.cpp",
42 "TargetLoweringObjectFile.cpp",
48 # 2. Forwarding targets.
49 group("NativeTarget") {
55 group("TargetsToBuild") {
56 deps = llvm_targets_to_build
59 group("AllTargetsAsmParsers") {
61 foreach(target, targets_with_asm_parsers) {
62 deps += [ "$target/AsmParser" ]
66 group("AllTargetsDescs") {
68 foreach(target, llvm_targets_to_build) {
69 deps += [ "$target/MCTargetDesc" ]
73 group("AllTargetsDisassemblers") {
75 foreach(target, targets_with_disassemblers) {
76 deps += [ "$target/Disassembler" ]
80 group("AllTargetsInfos") {
82 foreach(target, llvm_targets_to_build) {
83 deps += [ "$target/TargetInfo" ]