forked from MaterializeInc/materialize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
114 lines (99 loc) · 2.78 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
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
"""
Defines configuration attributes for the systems we target.
You can configure builds in Bazel using "configurable attributes" generally via
the `select(...)` function. The following setting groups define the targets we
support building Materialize for.
"""
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
# A flag that we can specify on the command line to configure whether or not we
# build with a sanitizer.
string_flag(
name = "sanitizer",
build_setting_default = "none",
values = [
"none",
"address",
"hwaddress",
],
)
config_setting(
name = "sanitizer_none",
flag_values = {":sanitizer": "none"},
)
config_setting(
name = "sanitizer_address",
flag_values = {":sanitizer": "address"},
)
config_setting(
name = "sanitizer_hwaddress",
flag_values = {":sanitizer": "hwaddress"},
)
bool_flag(
name = "xlang_lto",
build_setting_default = False,
)
config_setting(
name = "use_xlang_lto",
flag_values = {":xlang_lto": "True"},
)
# With our current toolchain setup, cross language LTO is only supported when building for Linux.
#
# See <https://github.com/rust-lang/rust/issues/60059> for macOS support.
selects.config_setting_group(
name = "xlang_lto_enabled",
match_all = [
"@platforms//os:linux",
":use_xlang_lto",
],
visibility = ["//visibility:public"],
)
# We only want to use jemalloc if we're building for Linux and we're not using sanitizers.
selects.config_setting_group(
name = "use_jemalloc",
match_all = [
"@platforms//os:linux",
":sanitizer_none",
],
visibility = ["//visibility:public"],
)
selects.config_setting_group(
name = "linux_x86_64",
match_all = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
visibility = ["//visibility:public"],
)
selects.config_setting_group(
name = "linux_arm",
match_all = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
visibility = ["//visibility:public"],
)
selects.config_setting_group(
name = "macos_x86_64",
match_all = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
visibility = ["//visibility:public"],
)
selects.config_setting_group(
name = "macos_arm",
match_all = [
"@platforms//os:macos",
"@platforms//cpu:arm64",
],
visibility = ["//visibility:public"],
)