xref: /llvm-project/llvm/utils/gn/secondary/bolt/unittests/Core/BUILD.gn (revision 897dbdeab7e86248183f2e20cb1ae35e59551f62)
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    "//bolt/lib/Profile",
10    "//llvm/lib/DebugInfo/DWARF",
11    "//llvm/lib/MC",
12    "//llvm/lib/Object",
13    "//llvm/lib/Target:TargetsToBuild",
14    "//llvm/lib/Testing/Support",
15  ]
16  sources = [
17    "BinaryContext.cpp",
18    "DynoStats.cpp",
19    "MCPlusBuilder.cpp",
20    "MemoryMaps.cpp",
21  ]
22
23  defines = []
24  include_dirs = []
25  if (llvm_build_AArch64) {
26    defines += [ "AARCH64_AVAILABLE" ]
27
28    # This target reaches into the internal headers of LLVM's AArch64 library.
29    # That target doesn't expect that, so it doesn't use public_deps for
30    # tblgen-generated headers used only in internal headers (...which this
31    # target here questionably includes). So depend on the target that generates
32    # those headers here.
33    include_dirs += [ "//llvm/lib/Target/AArch64" ]
34    deps += [
35      "//llvm/lib/Target/AArch64/MCTargetDesc",
36      "//llvm/lib/Target/AArch64/Utils",
37    ]
38  }
39  if (llvm_build_X86) {
40    defines += [ "X86_AVAILABLE" ]
41
42    # This target reaches into the internal headers of LLVM's X86 library.
43    # That target doesn't expect that, so it doesn't use public_deps for
44    # tblgen-generated headers used only in internal headers (...which this
45    # target here questionably includes). So depend on the target that generates
46    # those headers here.
47    include_dirs += [ "//llvm/lib/Target/X86" ]
48    deps += [ "//llvm/lib/Target/X86/MCTargetDesc" ]
49  }
50}
51