@@ -26,20 +26,34 @@ set(LLVM_DEFAULT_TARGET_TRIPLE x86_64-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
+
30
+ set (DEFAULT_BUILTIN_TARGETS
31
+ x86_64-unknown-windows-msvc
32
+ aarch64-unknown-windows-msvc )
33
+ # Build the android builtins if NDK path is provided.
34
+ if (NOT "$ENV{NDKPATH} " STREQUAL "" )
35
+ list (APPEND DEFAULT_BUILTIN_TARGETS
36
+ aarch64-unknown-linux-android
37
+ x86_64-unknown-linux-android)
38
+ endif ()
39
+
40
+ # The builtin targets are used to build the compiler-rt builtins.
41
+ set (LLVM_BUILTIN_TARGETS ${DEFAULT_BUILTIN_TARGETS} CACHE STRING "" )
42
+
43
+ # The runtime targets are used to build the compiler-rt profile library.
29
44
set (LLVM_RUNTIME_TARGETS
30
45
x86_64-unknown-windows-msvc
31
46
aarch64-unknown-windows-msvc
32
47
CACHE STRING "" )
48
+
33
49
foreach (target ${LLVM_RUNTIME_TARGETS} )
34
50
set (RUNTIMES_${target} _LLVM_ENABLE_RUNTIMES
35
51
compiler-rt
36
52
CACHE STRING "" )
37
53
set (RUNTIMES_${target} _CMAKE_MT mt CACHE STRING "" )
38
- if (${target} MATCHES windows-msvc )
39
- set (RUNTIMES_${target} _CMAKE_SYSTEM_NAME Windows CACHE STRING "" )
40
- endif ()
54
+ set (RUNTIMES_${target} _CMAKE_SYSTEM_NAME Windows CACHE STRING "" )
41
55
set (RUNTIMES_${target} _CMAKE_BUILD_TYPE Release CACHE STRING "" )
42
- set (RUNTIMES_${target} _COMPILER_RT_BUILD_BUILTINS YES CACHE BOOL "" )
56
+ set (RUNTIMES_${target} _COMPILER_RT_BUILD_BUILTINS NO CACHE BOOL "" )
43
57
set (RUNTIMES_${target} _COMPILER_RT_BUILD_CRT NO CACHE BOOL "" )
44
58
set (RUNTIMES_${target} _COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "" )
45
59
set (RUNTIMES_${target} _COMPILER_RT_BUILD_ORC NO CACHE BOOL "" )
@@ -48,6 +62,27 @@ foreach(target ${LLVM_RUNTIME_TARGETS})
48
62
set (RUNTIMES_${target} _COMPILER_RT_BUILD_XRAY NO CACHE BOOL "" )
49
63
endforeach ()
50
64
65
+ foreach (target ${LLVM_BUILTIN_TARGETS} )
66
+ set (BUILTINS_${target} _CMAKE_MT mt CACHE STRING "" )
67
+ if (${target} MATCHES windows-msvc )
68
+ set (BUILTINS_${target} _CMAKE_SYSTEM_NAME Windows CACHE STRING "" )
69
+ elseif (${target} MATCHES linux-android)
70
+ # Use a single 'linux' directory and arch-based lib names on Android.
71
+ set (BUILTINS_${target} _LLVM_ENABLE_PER_TARGET_RUNTIME_DIR NO CACHE BOOL "" )
72
+ set (BUILTINS_${target} _CMAKE_SYSTEM_NAME Android CACHE STRING "" )
73
+ if (${target} MATCHES aarch64)
74
+ set (BUILTINS_${target} _CMAKE_ANDROID_ARCH_ABI arm64-v8a CACHE STRING "" )
75
+ else ()
76
+ set (BUILTINS_${target} _CMAKE_ANDROID_ARCH_ABI x86_64 CACHE STRING "" )
77
+ endif ()
78
+ set (BUILTINS_${target} _CMAKE_ANDROID_NDK $ENV{NDKPATH} CACHE PATH "" )
79
+ set (BUILTINS_${target} _CMAKE_ANDROID_API 21 CACHE STRING "" )
80
+ set (BUILTINS_${target} _CMAKE_C_COMPILER_TARGET "${target} 21" CACHE STRING "" )
81
+ set (BUILTINS_${target} _CMAKE_CXX_COMPILER_TARGET "${target} 21" CACHE STRING "" )
82
+ endif ()
83
+ set (BUILTINS_${target} _CMAKE_BUILD_TYPE Release CACHE STRING "" )
84
+ endforeach ()
85
+
51
86
set (LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "" )
52
87
53
88
# Disable certain targets to reduce the configure time or to avoid configuration
@@ -168,6 +203,7 @@ set(LLVM_DISTRIBUTION_COMPONENTS
168
203
libclang
169
204
libclang-headers
170
205
LTO
206
+ builtins
171
207
runtimes
172
208
${LLVM_TOOLCHAIN_TOOLS}
173
209
${CLANG_TOOLS}
0 commit comments