@@ -26,18 +26,21 @@ llvm_all_targets = [
26
26
" X86" ,
27
27
]
28
28
29
+ # FIXME: This should be based off target_cpu once cross compiles work.
30
+ if (host_cpu == " arm64" ) {
31
+ native_target = " AArch64"
32
+ } else if (host_cpu == " arm" ) {
33
+ native_target = " ARM"
34
+ } else if (host_cpu == " ppc" || host_cpu == " ppc64" ) {
35
+ native_target = " PowerPC"
36
+ } else if (host_cpu == " x86" || host_cpu == " x64" ) {
37
+ native_target = " X86"
38
+ } else {
39
+ assert (false , " add your host_cpu above" )
40
+ }
41
+
29
42
if (llvm_targets_to_build == " host" ) {
30
- if (host_cpu == " arm64" ) {
31
- llvm_targets_to_build = [ " AArch64" ]
32
- } else if (host_cpu == " arm" ) {
33
- llvm_targets_to_build = [ " ARM" ]
34
- } else if (host_cpu == " ppc" || host_cpu == " ppc64" ) {
35
- llvm_targets_to_build = [ " PowerPC" ]
36
- } else if (host_cpu == " x86" || host_cpu == " x64" ) {
37
- llvm_targets_to_build = [ " X86" ]
38
- } else {
39
- assert (false , " add your host_cpu above" )
40
- }
43
+ llvm_targets_to_build = [ native_target ]
41
44
} else if (llvm_targets_to_build == " all" ) {
42
45
llvm_targets_to_build = llvm_all_targets
43
46
}
@@ -54,7 +57,11 @@ llvm_build_PowerPC = false
54
57
llvm_build_SystemZ = false
55
58
llvm_build_WebAssembly = false
56
59
llvm_build_X86 = false
60
+ llvm_build_native = false
57
61
foreach (target , llvm_targets_to_build ) {
62
+ if (target == native_target ) {
63
+ llvm_build_native = true
64
+ }
58
65
if (target == " AArch64" ) {
59
66
llvm_build_AArch64 = true
60
67
} else if (target == " AMDGPU" ) {
@@ -87,19 +94,6 @@ foreach(target, llvm_targets_to_build) {
87
94
}
88
95
}
89
96
90
- # FIXME: This should be based off target_cpu once cross compiles work.
91
- if (host_cpu == " arm64" ) {
92
- native_target = " AArch64"
93
- } else if (host_cpu == " arm" ) {
94
- native_target = " ARM"
95
- } else if (host_cpu == " ppc" || host_cpu == " ppc64" ) {
96
- native_target = " PowerPC"
97
- } else if (host_cpu == " x86" || host_cpu == " x64" ) {
98
- native_target = " X86"
99
- } else {
100
- assert (false , " Unsuppored host_cpu '$host_cpu '." )
101
- }
102
-
103
97
supported_android_toolchains = []
104
98
105
99
if (android_ndk_path != " " ) {
0 commit comments