@@ -26,21 +26,64 @@ set(LLVM_DEFAULT_TARGET_TRIPLE aarch64-unknown-windows-msvc CACHE STRING "")
26
26
set (LLVM_APPEND_VC_REV NO CACHE BOOL "" )
27
27
set (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "" )
28
28
set (LLVM_ENABLE_PYTHON YES CACHE BOOL "" )
29
- set (LLVM_RUNTIME_TARGETS
29
+
30
+ set (default_targets
31
+ x86_64-unknown-windows-msvc
30
32
aarch64-unknown-windows-msvc
31
- CACHE STRING "" )
33
+ i686-unknown-windows-msvc )
34
+ # Build the android builtins if NDK path is provided.
35
+ if (NOT "$ENV{NDKPATH} " STREQUAL "" )
36
+ list (APPEND default_targets
37
+ aarch64-unknown-linux-android
38
+ x86_64-unknown-linux-android
39
+ i686-unknown-linux-android
40
+ armv7-unknown-linux-androideabi )
41
+ endif ()
42
+
43
+ set (LLVM_BUILTIN_TARGETS ${default_targets} CACHE STRING "" )
44
+ set (LLVM_RUNTIME_TARGETS ${default_targets} CACHE STRING "" )
45
+
32
46
foreach (target ${LLVM_RUNTIME_TARGETS} )
33
47
set (RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES
34
48
compiler-rt
35
49
CACHE STRING "" )
36
50
set (RUNTIMES_${target}_CMAKE_MT mt CACHE STRING "" )
37
51
set (RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "" )
38
52
set (RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "" )
53
+ set (RUNTIMES_${target}_COMPILER_RT_BUILD_BUILTINS YES CACHE BOOL "" )
39
54
set (RUNTIMES_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "" )
40
55
set (RUNTIMES_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "" )
56
+ set (RUNTIMES_${target}_COMPILER_RT_BUILD_ORC NO CACHE BOOL "" )
41
57
set (RUNTIMES_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "" )
58
+ set (RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "" )
59
+ # Sanitizers will be configured, but not built. We have separate build
60
+ # steps for that, because we need a different shell for each target.
42
61
set (RUNTIMES_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "" )
43
- set (RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "" )
62
+ endforeach ()
63
+
64
+ foreach (target ${LLVM_BUILTIN_TARGETS} )
65
+ set (BUILTINS_${target}_CMAKE_MT mt CACHE STRING "" )
66
+ if (${target} MATCHES windows-msvc )
67
+ set (BUILTINS_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "" )
68
+ elseif (${target} MATCHES linux-android )
69
+ # Use a single 'linux' directory and arch-based lib names on Android.
70
+ set (BUILTINS_${target}_LLVM_ENABLE_PER_TARGET_RUNTIME_DIR NO CACHE BOOL "" )
71
+ set (BUILTINS_${target}_CMAKE_SYSTEM_NAME Android CACHE STRING "" )
72
+ if (${target} MATCHES aarch64 )
73
+ set (BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI arm64-v8a CACHE STRING "" )
74
+ elseif (${target} MATCHES armv7 )
75
+ set (BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI armeabi-v7a CACHE STRING "" )
76
+ elseif (${target} MATCHES i686 )
77
+ set (BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI i686 CACHE STRING "" )
78
+ else ()
79
+ set (BUILTINS_${target}_CMAKE_ANDROID_ARCH_ABI x86_64 CACHE STRING "" )
80
+ endif ()
81
+ set (BUILTINS_${target}_CMAKE_ANDROID_NDK $ENV{NDKPATH} CACHE PATH "" )
82
+ set (BUILTINS_${target}_CMAKE_ANDROID_API 21 CACHE STRING "" )
83
+ set (BUILTINS_${target}_CMAKE_C_COMPILER_TARGET "${target} 21" CACHE STRING "" )
84
+ set (BUILTINS_${target}_CMAKE_CXX_COMPILER_TARGET "${target} 21" CACHE STRING "" )
85
+ endif ()
86
+ set (BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "" )
44
87
endforeach ()
45
88
46
89
set (LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "" )
@@ -165,6 +208,7 @@ set(LLVM_DISTRIBUTION_COMPONENTS
165
208
libclang
166
209
libclang-headers
167
210
LTO
211
+ builtins
168
212
runtimes
169
213
${LLVM_TOOLCHAIN_TOOLS}
170
214
${CLANG_TOOLS}
0 commit comments