1import("//llvm/lib/Target/targets.gni")
2import("//third-party/unittest/unittest.gni")
3
4unittest("CoreTests") {
5  configs += [ "//llvm/utils/gn/build:bolt_code" ]
6  deps = [
7    "//bolt/lib/Core",
8    "//bolt/lib/Rewrite",
9    "//llvm/lib/DebugInfo/DWARF",
10    "//llvm/lib/MC",
11    "//llvm/lib/Object",
12    "//llvm/lib/Target:TargetsToBuild",
13  ]
14  sources = [
15    "BinaryContext.cpp",
16    "DynoStats.cpp",
17    "MCPlusBuilder.cpp",
18  ]
19
20  defines = []
21  include_dirs = []
22  if (llvm_build_AArch64) {
23    defines += [ "AARCH64_AVAILABLE" ]
24
25    # This target reaches into the internal headers of LLVM's AArch64 library.
26    # That target doesn't expect that, so it doesn't use public_deps for
27    # tblgen-generated headers used only in internal headers (...which this
28    # target here questionably includes). So depend on the target that generates
29    # those headers here.
30    include_dirs += [ "//llvm/lib/Target/AArch64" ]
31    deps += [
32      "//llvm/lib/Target/AArch64/MCTargetDesc",
33      "//llvm/lib/Target/AArch64/Utils",
34    ]
35  }
36  if (llvm_build_X86) {
37    defines += [ "X86_AVAILABLE" ]
38
39    # This target reaches into the internal headers of LLVM's X86 library.
40    # That target doesn't expect that, so it doesn't use public_deps for
41    # tblgen-generated headers used only in internal headers (...which this
42    # target here questionably includes). So depend on the target that generates
43    # those headers here.
44    include_dirs += [ "//llvm/lib/Target/X86" ]
45    deps += [ "//llvm/lib/Target/X86/MCTargetDesc" ]
46  }
47}
48