summaryrefslogtreecommitdiff
path: root/toxcore/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/BUILD')
-rw-r--r--toxcore/BUILD205
1 files changed, 161 insertions, 44 deletions
diff --git a/toxcore/BUILD b/toxcore/BUILD
index 8dfa60a5..f7dc5861 100644
--- a/toxcore/BUILD
+++ b/toxcore/BUILD
@@ -1,15 +1,14 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1filegroup( 3filegroup(
2 name = "public", 4 name = "public_headers",
3 srcs = ["tox.h"], 5 srcs = ["tox.h"],
4 visibility = ["//visibility:public"], 6 visibility = ["//c-toxcore:__pkg__"],
5) 7)
6 8
7cc_library( 9cc_library(
8 name = "ccompat", 10 name = "ccompat",
9 hdrs = [ 11 hdrs = ["ccompat.h"],
10 "ccompat.h",
11 ],
12 visibility = ["//visibility:public"],
13) 12)
14 13
15cc_library( 14cc_library(
@@ -21,7 +20,7 @@ cc_library(
21 hdrs = [ 20 hdrs = [
22 "crypto_core.h", 21 "crypto_core.h",
23 ], 22 ],
24 visibility = ["//c-toxcore:__subpackages__"], 23 visibility = ["//c-toxcore/toxencryptsave:__pkg__"],
25 deps = [ 24 deps = [
26 ":ccompat", 25 ":ccompat",
27 "@libsodium", 26 "@libsodium",
@@ -29,60 +28,170 @@ cc_library(
29) 28)
30 29
31cc_library( 30cc_library(
32 name = "toxcore", 31 name = "list",
32 srcs = ["list.c"],
33 hdrs = ["list.h"],
34)
35
36cc_library(
37 name = "logger",
38 srcs = ["logger.c"],
39 hdrs = ["logger.h"],
40)
41
42cc_library(
43 name = "network",
44 srcs = [
45 "network.c",
46 "util.c",
47 ],
48 hdrs = [
49 "network.h",
50 "util.h",
51 ],
52 linkopts = ["-lpthread"],
53 visibility = [
54 "//c-toxcore/other:__pkg__",
55 "//c-toxcore/toxav:__pkg__",
56 ],
57 deps = [
58 ":ccompat",
59 ":crypto_core",
60 ":logger",
61 ],
62)
63
64cc_library(
65 name = "ping_array",
66 srcs = ["ping_array.c"],
67 hdrs = ["ping_array.h"],
68 deps = [":network"],
69)
70
71cc_library(
72 name = "DHT",
33 srcs = [ 73 srcs = [
34 "DHT.c", 74 "DHT.c",
35 "DHT.h",
36 "LAN_discovery.c", 75 "LAN_discovery.c",
76 "ping.c",
77 ],
78 hdrs = [
79 "DHT.h",
37 "LAN_discovery.h", 80 "LAN_discovery.h",
38 "Messenger.c", 81 "ping.h",
39 "Messenger.h", 82 ],
83 copts = [
84 "-Wno-parentheses",
85 ],
86 visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"],
87 deps = [
88 ":crypto_core",
89 ":logger",
90 ":ping_array",
91 ],
92)
93
94cc_library(
95 name = "onion",
96 srcs = ["onion.c"],
97 hdrs = ["onion.h"],
98 deps = [":DHT"],
99)
100
101cc_library(
102 name = "TCP_connection",
103 srcs = [
40 "TCP_client.c", 104 "TCP_client.c",
41 "TCP_client.h",
42 "TCP_connection.c", 105 "TCP_connection.c",
43 "TCP_connection.h",
44 "TCP_server.c", 106 "TCP_server.c",
107 ],
108 hdrs = [
109 "TCP_client.h",
110 "TCP_connection.h",
45 "TCP_server.h", 111 "TCP_server.h",
46 "friend_connection.c", 112 ],
47 "friend_connection.h", 113 deps = [
48 "friend_requests.c", 114 ":crypto_core",
49 "friend_requests.h", 115 ":list",
50 "group.c", 116 ":onion",
51 "group.h", 117 ],
52 "list.c", 118)
53 "list.h", 119
54 "logger.c", 120cc_library(
55 "logger.h", 121 name = "net_crypto",
56 "net_crypto.c", 122 srcs = ["net_crypto.c"],
57 "net_crypto.h", 123 hdrs = ["net_crypto.h"],
58 "network.c", 124 deps = [
59 "network.h", 125 ":DHT",
60 "onion.c", 126 ":TCP_connection",
61 "onion.h", 127 ],
62 "onion_announce.c", 128)
63 "onion_announce.h", 129
64 "onion_client.c", 130cc_library(
65 "onion_client.h", 131 name = "onion_announce",
66 "ping.c", 132 srcs = ["onion_announce.c"],
67 "ping.h", 133 hdrs = ["onion_announce.h"],
68 "ping_array.c", 134 deps = [":onion"],
69 "ping_array.h", 135)
136
137cc_library(
138 name = "onion_client",
139 srcs = ["onion_client.c"],
140 hdrs = ["onion_client.h"],
141 deps = [
142 ":net_crypto",
143 ":onion_announce",
144 ],
145)
146
147cc_library(
148 name = "friend_connection",
149 srcs = ["friend_connection.c"],
150 hdrs = ["friend_connection.h"],
151 deps = [
152 ":DHT",
153 ":net_crypto",
154 ":onion_client",
155 ],
156)
157
158cc_library(
159 name = "friend_requests",
160 srcs = ["friend_requests.c"],
161 hdrs = ["friend_requests.h"],
162 deps = [":friend_connection"],
163)
164
165cc_library(
166 name = "Messenger",
167 srcs = ["Messenger.c"],
168 hdrs = ["Messenger.h"],
169 visibility = ["//c-toxcore/toxav:__pkg__"],
170 deps = [":friend_requests"],
171)
172
173cc_library(
174 name = "group",
175 srcs = ["group.c"],
176 hdrs = ["group.h"],
177 visibility = ["//c-toxcore/toxav:__pkg__"],
178 deps = [":Messenger"],
179)
180
181cc_library(
182 name = "toxcore",
183 srcs = [
70 "tox.c", 184 "tox.c",
71 "tox.h", 185 "tox.h",
72 "tox_api.c", 186 "tox_api.c",
73 "util.c",
74 "util.h",
75 ], 187 ],
76 copts = [ 188 copts = [
77 "-std=c99",
78 "-Wno-parentheses", 189 "-Wno-parentheses",
79 ], 190 ],
80 linkopts = ["-lpthread"],
81 visibility = ["//visibility:public"], 191 visibility = ["//visibility:public"],
82 deps = [ 192 deps = [
83 ":ccompat", 193 ":group",
84 ":crypto_core", 194 "//c-toxcore/toxencryptsave:defines",
85 "//c-toxcore/toxencryptsave",
86 ], 195 ],
87) 196)
88 197
@@ -92,5 +201,13 @@ cc_library(
92 "*.c", 201 "*.c",
93 "*.h", 202 "*.h",
94 ]), 203 ]),
204 copts = [
205 "-Wno-parentheses",
206 ],
207 linkopts = ["-lpthread"],
95 visibility = ["//c-toxcore/other:__pkg__"], 208 visibility = ["//c-toxcore/other:__pkg__"],
209 deps = [
210 "//c-toxcore/toxencryptsave:defines",
211 "@libsodium",
212 ],
96) 213)