-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
BUILD.tpl
112 lines (100 loc) · 3.08 KB
/
BUILD.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
package(default_visibility = ["//visibility:public"])
load("@bazel_tools//tools/osx/crosstool:osx_archs.bzl", "OSX_TOOLS_ARCHS")
load("@rules_cc//cc:defs.bzl", "cc_toolchain_suite", "cc_library")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
# Reexporting osx_arch.bzl for backwards compatibility
# Originally this file was present in @local_config_cc, but with the split in
# https://github.com/bazelbuild/bazel/pull/8459 we had to move the file to
# @local_config_cc_toolchains. This alias is there to keep the code backwards
# compatible (and serves no other purpose).
alias(name = "osx_archs.bzl", actual = "@bazel_tools//tools/osx/crosstool:osx_archs.bzl")
CC_TOOLCHAINS = [(
cpu + "|compiler",
":cc-compiler-" + cpu,
) for cpu in OSX_TOOLS_ARCHS] + [(
cpu,
":cc-compiler-" + cpu,
) for cpu in OSX_TOOLS_ARCHS] + [
("k8|compiler", ":cc-compiler-darwin_x86_64"),
("darwin|compiler", ":cc-compiler-darwin_x86_64"),
("k8", ":cc-compiler-darwin_x86_64"),
("darwin", ":cc-compiler-darwin_x86_64"),
("armeabi-v7a|compiler", ":cc-compiler-armeabi-v7a"),
("armeabi-v7a", ":cc-compiler-armeabi-v7a"),
]
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
cc_toolchain_suite(
name = "toolchain",
toolchains = dict(CC_TOOLCHAINS),
)
[
filegroup(
name = "osx_tools_" + arch,
srcs = [
":cc_wrapper",
":libtool",
":libtool_check_unique",
":make_hashed_objlist.py",
":wrapped_clang",
":wrapped_clang_pp",
":xcrunwrapper.sh",
],
)
for arch in OSX_TOOLS_ARCHS
]
[
apple_cc_toolchain(
name = "cc-compiler-" + arch,
all_files = ":osx_tools_" + arch,
ar_files = ":osx_tools_" + arch,
as_files = ":osx_tools_" + arch,
compiler_files = ":osx_tools_" + arch,
dwp_files = ":empty",
linker_files = ":osx_tools_" + arch,
objcopy_files = ":empty",
strip_files = ":osx_tools_" + arch,
supports_param_files = 1,
toolchain_config = arch,
toolchain_identifier = arch,
)
for arch in OSX_TOOLS_ARCHS
]
[
cc_toolchain_config(
name = arch,
compiler = "compiler",
cpu = arch,
cxx_builtin_include_directories = [
%{cxx_builtin_include_directories}
],
tool_paths_overrides = {%{tool_paths_overrides}},
)
for arch in OSX_TOOLS_ARCHS
]
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
toolchain_config = ":stub_armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")