forked from urbit/vere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
49 lines (45 loc) · 1.1 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
#
# LIBRARIES
#
load("//bazel:common_settings.bzl", "vere_library")
vere_library(
name = "ent",
srcs = ["ent.c"],
hdrs = ["ent.h"],
copts = [
"-O3",
"-Wall",
"-Werror",
"-pedantic",
"-std=gnu99",
],
include_prefix = "ent",
includes = ["."],
linkstatic = True,
local_defines = select({
"@platforms//os:macos": ["ENT_GETENTROPY_SYSRANDOM"],
# TODO: support fallback to other options if `getrandom()` isn't
# available in `unistd.h`. Preferred order (from most preferred to least
# preferred) is:
# - ENT_GETENTROPY_UNISTD
# - ENT_GETENTROPY_SYSRANDOM
# - ENT_GETRANDOM_SYSCALL
# - ENT_DEV_URANDOM
"//conditions:default": ["ENT_GETENTROPY_UNISTD"],
}),
visibility = ["//:__subpackages__"],
)
#
# TESTS
#
cc_test(
name = "tests",
timeout = "short",
srcs = ["tests.c"],
features = select({
"@platforms//os:linux": ["fully_static_link"],
"//conditions:default": [],
}),
visibility = ["//visibility:private"],
deps = [":ent"],
)