-
Notifications
You must be signed in to change notification settings - Fork 4
/
libsodium.BUILD
77 lines (70 loc) · 1.31 KB
/
libsodium.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
66
67
68
69
70
71
72
73
74
75
76
77
package(default_visibility = ["//visibility:public"])
genrule(
name = "configure_sh",
outs = [
"configure.sh",
],
cmd = """
cat > $@ <<"EOF"
#! /bin/sh
./external/libsodium/configure >> /dev/null
EOF"""
)
filegroup(
name = "all",
srcs = glob(["**/*"])
)
VERSION_H_PATH = "src/libsodium/include/sodium/version.h"
genrule(
name = "version_h",
srcs = [
":all",
],
outs = [
VERSION_H_PATH,
],
cmd = "$(location :configure_sh) && cat {} > $(@)".format(VERSION_H_PATH),
tools = [":configure_sh"],
)
filegroup(
name = "headers",
srcs = glob(
["**/*.h"],
exclude = ["test/**/*"],
),
)
filegroup(
name = "srcs",
srcs = glob(
["**/*.c"],
exclude = ["test/**/*"],
),
)
cc_library(
name = "sodium",
hdrs = [
":headers",
":version_h",
],
srcs = [
":srcs",
],
includes = [
"src/libsodium/include",
"src/libsodium/include/sodium",
],
copts = [
"-Wno-cpp",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-unused-function",
"-Wno-unused-value",
"-Wno-unused-variable",
"-Wno-#warnings",
],
)
cc_binary(
name = "libsodium",
deps = [":sodium"],
linkstatic = 1,
)