reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
import("//llvm/lib/Target/targets.gni")
import("//llvm/lib/Target/targets_with_asm_parsers.gni")
import("//llvm/lib/Target/targets_with_disassemblers.gni")

# This build file has two parts:
# 1. The actual //llvm/lib/Target build target, which is just a static
#    library containing the cpp files in this directory.  It contains general
#    shared target code.
# 2. Forwarding targets that forward to the concrete targets (X86, ARM, ...).
#    These are defined in subdirectories, and the forwarding names match
#    the names of the forwarding targets in CMake.  They all (indirectly,
#    through CodeGen) depend on the //llvm/lib/Target build target.
# (See also `gn help labels`).
# The dependency chain is:
# //llvm/lib/Target:TargetsToBuild (a target in this file) ->
# /llvm/lib/Target/(X86|ARM|...) (in the subdirectories) ->
# //llvm/lib/CodeGen ->
# //llvm/lib/Target (a target in this file again)
# Note that while this file appears twice in that stack, it's with different
# targets in this file, so there's no cyclic dependency.

# 1. Actual build target.
static_library("Target") {
  output_name = "LLVMTarget"
  deps = [
    "//llvm/lib/Analysis",
    "//llvm/lib/IR",
    "//llvm/lib/MC",
    "//llvm/lib/Support",
  ]
  public_deps = [
    # This is a bit of a hack: llvm-c/Target.h includes llvm/Config/Targets.def,
    # but there's no target corresponding to llvm-c. Since the functions
    # declared in llvm-c/Target.h are defined in llvm/lib/Target, clients of
    # it must depend on llvm/lib/Target, so add the public_dep for Targets.def
    # here.
    "//llvm/include/llvm/Config:write_target_def_files",
  ]
  sources = [
    "Target.cpp",
    "TargetIntrinsicInfo.cpp",
    "TargetLoweringObjectFile.cpp",
    "TargetMachine.cpp",
    "TargetMachineC.cpp",
  ]
}

# 2. Forwarding targets.
group("NativeTarget") {
  deps = [
    "$native_target",
  ]
}

group("TargetsToBuild") {
  deps = llvm_targets_to_build
}

group("AllTargetsAsmParsers") {
  deps = []
  foreach(target, targets_with_asm_parsers) {
    deps += [ "$target/AsmParser" ]
  }
}

group("AllTargetsDescs") {
  deps = []
  foreach(target, llvm_targets_to_build) {
    deps += [ "$target/MCTargetDesc" ]
  }
}

group("AllTargetsDisassemblers") {
  deps = []
  foreach(target, targets_with_disassemblers) {
    deps += [ "$target/Disassembler" ]
  }
}

group("AllTargetsInfos") {
  deps = []
  foreach(target, llvm_targets_to_build) {
    deps += [ "$target/TargetInfo" ]
  }
}