-
Notifications
You must be signed in to change notification settings - Fork 4
/
BUILD
65 lines (57 loc) · 1.3 KB
/
BUILD
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
load("@bazel_skylib//rules:common_settings.bzl", "string_flag", "string_list_flag")
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
exports_files(
[
".cargo/config.toml",
"Cargo.toml",
],
visibility = ["//visibility:public"],
)
string_flag(
name = "version",
build_setting_default = "0",
visibility = ["//visibility:public"],
)
string_flag(
name = "rev", # `git rev-parse --short=10 HEAD`
build_setting_default = "unknown",
visibility = ["//visibility:public"],
)
string_list_flag(
name = "features",
build_setting_default = [],
)
config_setting(
name = "enable_negotiate",
flag_values = {
":features": "negotiate",
},
)
platform(
name = "x86_64-apple-darwin",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:macos",
],
)
platform(
name = "aarch64-apple-darwin",
constraint_values = [
"@platforms//cpu:arm64",
"@platforms//os:macos",
],
)
native_binary(
name = "current_version",
out = "current_version",
src = "//tools:toml_get",
args = [
"-f$(location //:Cargo.toml)",
"-nversion",
"workspace",
"package",
"version",
],
data = ["//:Cargo.toml"],
visibility = ["//visibility:public"],
)