2 # The target archs LLVM should support. Defaults to the host arch.
3 # Set to a list, e.g. `llvm_targets_to_build = [ "X86", "ARM" ]`,
4 # or to the string "all" to get all known targets.
5 llvm_targets_to_build = "host"
8 if (llvm_targets_to_build == "host") {
9 if (host_cpu == "arm64") {
10 llvm_targets_to_build = [ "AArch64" ]
11 } else if (host_cpu == "arm") {
12 llvm_targets_to_build = [ "ARM" ]
13 } else if (host_cpu == "ppc" || host_cpu == "ppc64") {
14 llvm_targets_to_build = [ "PowerPC" ]
15 } else if (host_cpu == "x86" || host_cpu == "x64") {
16 llvm_targets_to_build = [ "X86" ]
18 assert(false, "add your host_cpu above")
20 } else if (llvm_targets_to_build == "all") {
21 # FIXME: Port the remaining targets.
22 llvm_targets_to_build = [
39 # Validate that llvm_targets_to_build is set to a list of valid targets,
40 # and remember which targets are built.
41 llvm_build_AArch64 = false
42 llvm_build_ARM = false
43 llvm_build_BPF = false
44 llvm_build_PowerPC = false
45 llvm_build_WebAssembly = false
46 llvm_build_X86 = false
47 foreach(target, llvm_targets_to_build) {
48 if (target == "AArch64") {
49 llvm_build_AArch64 = true
50 } else if (target == "AMDGPU") {
52 } else if (target == "ARM") {
54 } else if (target == "BPF") {
56 } else if (target == "Hexagon") {
58 } else if (target == "Lanai") {
60 } else if (target == "Mips") {
62 } else if (target == "NVPTX") {
64 } else if (target == "PowerPC") {
65 llvm_build_PowerPC = true
66 } else if (target == "RISCV") {
68 } else if (target == "Sparc") {
70 } else if (target == "SystemZ") {
72 } else if (target == "WebAssembly") {
73 llvm_build_WebAssembly = true
74 } else if (target == "X86") {
77 # FIXME: Port the remaining targets.
78 assert(false, "Unknown target '$target'.")
82 # FIXME: This should be based off target_cpu once cross compiles work.
83 if (host_cpu == "arm64") {
84 native_target = "AArch64"
85 } else if (host_cpu == "arm") {
87 } else if (host_cpu == "ppc" || host_cpu == "ppc64") {
88 native_target = "PowerPC"
89 } else if (host_cpu == "x86" || host_cpu == "x64") {
92 assert(false, "Unsuppored host_cpu '$host_cpu'.")