-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBUILD.bazel
164 lines (151 loc) · 4.99 KB
/
BUILD.bazel
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"x86_64-unknown-cloudabi": ":cc-compiler-x86_64-unknown-cloudabi",
"darwin": "cc-compiler-x86_64-apple-darwin",
"freebsd": "cc-compiler-x86_64-unknown-freebsd",
"k8": "cc-compiler-x86_64-unknown-linux-gnu",
},
visibility = ["//visibility:public"],
)
filegroup(name = "empty")
config_setting(
name = "host_x86_64_apple_darwin",
values = {"host_cpu": "darwin"},
visibility = ["//visibility:public"],
)
config_setting(
name = "host_x86_64_unknown_freebsd",
values = {"host_cpu": "freebsd"},
visibility = ["//visibility:public"],
)
config_setting(
name = "host_x86_64_unknown_linux_gnu",
values = {"host_cpu": "k8"},
visibility = ["//visibility:public"],
)
filegroup(
name = "compiler_files",
srcs = [
":wrappers/clang",
"@org_cloudabi_cloudlibc//src/include",
"@org_llvm_cfe//:clang_headers",
"@org_llvm_libcxx//:libcxx_headers",
] + select({
":host_x86_64_apple_darwin": ["@org_llvm_llvm_x86_64_apple_darwin//:bin/clang-7"],
":host_x86_64_unknown_freebsd": ["@org_llvm_llvm_x86_64_unknown_freebsd//:bin/clang-7"],
":host_x86_64_unknown_linux_gnu": ["@org_llvm_llvm_x86_64_unknown_linux_gnu//:bin/clang-7"],
}),
)
filegroup(
name = "linker_files",
srcs = [
":wrappers/clang",
":wrappers/llvm-ar",
"//library_stubs",
] + select({
":host_x86_64_apple_darwin": [
"@org_llvm_llvm_x86_64_apple_darwin//:bin/clang-7",
"@org_llvm_llvm_x86_64_apple_darwin//:bin/lld",
"@org_llvm_llvm_x86_64_apple_darwin//:bin/llvm-ar",
],
":host_x86_64_unknown_freebsd": [
"@org_llvm_llvm_x86_64_unknown_freebsd//:bin/clang-7",
"@org_llvm_llvm_x86_64_unknown_freebsd//:bin/lld",
"@org_llvm_llvm_x86_64_unknown_freebsd//:bin/llvm-ar",
],
":host_x86_64_unknown_linux_gnu": [
"@org_llvm_llvm_x86_64_unknown_linux_gnu//:bin/clang-7",
"@org_llvm_llvm_x86_64_unknown_linux_gnu//:bin/lld",
"@org_llvm_llvm_x86_64_unknown_linux_gnu//:bin/llvm-ar",
],
}),
)
cc_toolchain(
name = "cc-compiler-x86_64-unknown-cloudabi",
all_files = ":compiler_files",
compiler_files = ":compiler_files",
cpu = "x86_64-unknown-cloudabi",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":linker_files",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 0,
toolchain_identifier = "x86_64-unknown-cloudabi",
visibility = ["//visibility:public"],
)
toolchain(
name = "cc-toolchain-x86_64-unknown-cloudabi",
toolchain = ":cc-compiler-x86_64-unknown-cloudabi",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
# TODO(ed): Why do we need to declare this here? Can't Bazel be
# configured to register our toolchains in addition to the ones it knows
# by default?
cc_toolchain(
name = "cc-compiler-x86_64-apple-darwin",
all_files = ":empty",
compiler_files = ":empty",
cpu = "x86_64-apple-darwin",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":empty",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 0,
toolchain_identifier = "x86_64-apple-darwin",
visibility = ["//visibility:public"],
)
cc_toolchain(
name = "cc-compiler-x86_64-unknown-freebsd",
all_files = ":empty",
compiler_files = ":empty",
cpu = "x86_64-unknown-freebsd",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":empty",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 0,
toolchain_identifier = "x86_64-unknown-freebsd",
visibility = ["//visibility:public"],
)
cc_toolchain(
name = "cc-compiler-x86_64-unknown-linux-gnu",
all_files = ":empty",
compiler_files = ":empty",
cpu = "x86_64-unknown-linux-gnu",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = ":empty",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 0,
toolchain_identifier = "x86_64-unknown-linux-gnu",
visibility = ["//visibility:public"],
)
cc_library(
name = "cxx_runtime",
visibility = ["//visibility:public"],
deps = [
"@net_jemalloc_jemalloc//:jemalloc",
"@org_cloudabi_cloudlibc//src/crt",
"@org_cloudabi_cloudlibc//src/libc",
"@org_llvm_compiler_rt//:compiler-rt",
"@org_llvm_libcxx//:libcxx",
"@org_llvm_libunwind//:libunwind",
"@org_musl_libc_musl//src/complex",
"@org_musl_libc_musl//src/math",
],
)
cc_binary(
name = "run_test",
srcs = ["run_test.c"],
visibility = ["//visibility:public"],
deps = ["@org_cloudabi_cloudabi_utils//src/libcloudabi"],
)