-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathBUILD.ndk_clang.tpl
142 lines (121 loc) · 4.01 KB
/
BUILD.ndk_clang.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
"""Declarations for the NDK's Clang directory."""
load("@@{repository_name}//:ndk_cc_toolchain_config.bzl", "ndk_cc_toolchain_config_rule")
load("//:target_systems.bzl", "TARGET_SYSTEM_NAMES")
package(default_visibility = ["//visibility:public"])
cc_toolchain_suite(
name = "cc_toolchain_suite",
toolchains = {
"armeabi-v7a": ":cc_toolchain_arm-linux-androideabi",
"arm64-v8a": ":cc_toolchain_aarch64-linux-android",
"x86": ":cc_toolchain_i686-linux-android",
"x86_64": ":cc_toolchain_x86_64-linux-android",
},
)
[cc_toolchain(
name = "cc_toolchain_%s" % target_system_name,
all_files = ":all_files",
ar_files = ":ar_files",
as_files = ":as_files",
compiler_files = ":compiler_files_%s" % target_system_name,
coverage_files = ":coverage_files",
dwp_files = ":dwp_files",
dynamic_runtime_lib = ":dynamic_runtime_lib_%s" % target_system_name,
libc_top = ":libc_top_%s" % target_system_name,
linker_files = ":linker_files_%s" % target_system_name,
objcopy_files = ":objcopy_files",
static_runtime_lib = "static_runtime_lib_%s" % target_system_name,
strip_files = ":strip_files",
supports_header_parsing = 0,
toolchain_config = ":toolchain_config_%s" % target_system_name,
toolchain_identifier = "toolchain_identifier_%s" % target_system_name,
) for target_system_name in TARGET_SYSTEM_NAMES]
[ndk_cc_toolchain_config_rule(
name = "toolchain_config_%s" % target_system_name,
api_level = {api_level},
clang_resource_directory = "{clang_resource_directory}",
target_system_name = target_system_name,
toolchain_identifier = "toolchain_identifier_%s" % target_system_name,
executable_extension = "{executable_extension}",
) for target_system_name in TARGET_SYSTEM_NAMES]
filegroup(
name = "all_binaries",
srcs = glob([
"bin/*",
"lib64/**/*",
"lib/**/*",
]),
)
filegroup(
name = "all_files",
srcs = glob(["**/*"]) + ["//{sysroot_directory}:all_files"],
)
filegroup(
name = "ar_files",
srcs = [":all_binaries"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "as_files",
srcs = [":all_binaries"],
output_licenses = ["unencumbered"],
)
[filegroup(
name = "compiler_files_%s" % target_system_name,
srcs = [
"bin/clang{executable_extension}",
":ar_files",
":as_files",
":objcopy_files",
"//{sysroot_directory}:sysroot_includes",
] + glob([
"prebuilt_include/**",
"include/**",
"lib/gcc/%s/**" % target_system_name,
"lib64/**/*",
"lib/**/*",
], allow_empty = True),
output_licenses = ["unencumbered"],
) for target_system_name in TARGET_SYSTEM_NAMES]
filegroup(
name = "coverage_files",
srcs = [":all_binaries"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "dwp_files",
srcs = [":all_binaries"],
output_licenses = ["unencumbered"],
)
[filegroup(
name = "dynamic_runtime_lib_%s" % target_system_name,
srcs = ["//{sysroot_directory}:dynamic_runtime_lib_%s" % target_system_name],
) for target_system_name in TARGET_SYSTEM_NAMES]
[filegroup(
name = "libc_top_%s" % target_system_name,
srcs = ["//{sysroot_directory}:libc_top_%s" % target_system_name],
) for target_system_name in TARGET_SYSTEM_NAMES]
[filegroup(
name = "linker_files_%s" % target_system_name,
srcs = [
":all_binaries",
":static_runtime_lib_%s" % target_system_name,
] + glob([
"lib/gcc/%s/**" % target_system_name,
"lib64/**",
"lib/**",
], allow_empty = True),
) for target_system_name in TARGET_SYSTEM_NAMES]
filegroup(
name = "objcopy_files",
srcs = [":all_binaries"],
output_licenses = ["unencumbered"],
)
[filegroup(
name = "static_runtime_lib_%s" % target_system_name,
srcs = ["//{sysroot_directory}:static_runtime_lib_%s" % target_system_name],
) for target_system_name in TARGET_SYSTEM_NAMES]
filegroup(
name = "strip_files",
srcs = [":all_files"],
output_licenses = ["unencumbered"],
)