forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.redis
67 lines (64 loc) · 1.67 KB
/
BUILD.redis
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
exports_files(
[
"redis-server.exe",
"redis-cli.exe",
],
visibility = ["//visibility:public"],
)
genrule(
name = "bin",
srcs = glob(["**"]),
outs = [
"redis-server",
"redis-cli",
],
cmd = """
unset CC LDFLAGS CXX CXXFLAGS
tmpdir="redis.tmp"
p=$(location Makefile)
cp -p -L -R -- "$${p%/*}" "$${tmpdir}"
chmod +x "$${tmpdir}"/deps/jemalloc/configure
parallel="$$(getconf _NPROCESSORS_ONLN || echo 1)"
make -s -C "$${tmpdir}" -j"$${parallel}" V=0 CFLAGS="$${CFLAGS-} -DLUA_USE_MKSTEMP -Wno-pragmas -Wno-empty-body"
mv "$${tmpdir}"/src/redis-server $(location redis-server)
chmod +x $(location redis-server)
mv "$${tmpdir}"/src/redis-cli $(location redis-cli)
chmod +x $(location redis-cli)
rm -r -f -- "$${tmpdir}"
""",
visibility = ["//visibility:public"],
tags = ["local"],
)
# This library is for internal hiredis use, because hiredis assumes a
# different include prefix for itself than external libraries do.
cc_library(
name = "_hiredis",
hdrs = [
"deps/hiredis/dict.c",
"deps/hiredis/dict.h",
"deps/hiredis/fmacros.h",
],
strip_include_prefix = "deps/hiredis",
)
cc_library(
name = "hiredis",
srcs = glob(
[
"deps/hiredis/*.c",
"deps/hiredis/*.h",
],
exclude =
[
"deps/hiredis/test.c",
],
),
hdrs = glob([
"deps/hiredis/*.h",
"deps/hiredis/adapters/*.h",
]),
strip_include_prefix = "deps",
deps = [
":_hiredis",
],
visibility = ["//visibility:public"],
)