summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD12
-rw-r--r--auto_tests/BUILD4
-rw-r--r--other/BUILD4
-rw-r--r--testing/BUILD2
-rw-r--r--toxav/BUILD100
-rw-r--r--toxcore/BUILD205
-rw-r--r--toxencryptsave/BUILD30
7 files changed, 269 insertions, 88 deletions
diff --git a/BUILD b/BUILD
index 58dc7b43..69fa5788 100644
--- a/BUILD
+++ b/BUILD
@@ -1,9 +1,9 @@
1genrule( 1genrule(
2 name = "copy_headers", 2 name = "copy_headers",
3 srcs = [ 3 srcs = [
4 "//c-toxcore/toxav:public", 4 "//c-toxcore/toxav:public_headers",
5 "//c-toxcore/toxcore:public", 5 "//c-toxcore/toxcore:public_headers",
6 "//c-toxcore/toxencryptsave:public", 6 "//c-toxcore/toxencryptsave:public_headers",
7 ], 7 ],
8 outs = [ 8 outs = [
9 "tox/toxav.h", 9 "tox/toxav.h",
@@ -11,9 +11,9 @@ genrule(
11 "tox/toxencryptsave.h", 11 "tox/toxencryptsave.h",
12 ], 12 ],
13 cmd = """ 13 cmd = """
14 cp $(location //c-toxcore/toxav:public) $(GENDIR)/c-toxcore/tox/toxav.h 14 cp $(location //c-toxcore/toxav:public_headers) $(GENDIR)/c-toxcore/tox/toxav.h
15 cp $(location //c-toxcore/toxcore:public) $(GENDIR)/c-toxcore/tox/tox.h 15 cp $(location //c-toxcore/toxcore:public_headers) $(GENDIR)/c-toxcore/tox/tox.h
16 cp $(location //c-toxcore/toxencryptsave:public) $(GENDIR)/c-toxcore/tox/toxencryptsave.h 16 cp $(location //c-toxcore/toxencryptsave:public_headers) $(GENDIR)/c-toxcore/tox/toxencryptsave.h
17 """, 17 """,
18) 18)
19 19
diff --git a/auto_tests/BUILD b/auto_tests/BUILD
index 268532e1..f4542ccb 100644
--- a/auto_tests/BUILD
+++ b/auto_tests/BUILD
@@ -1,3 +1,5 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1cc_library( 3cc_library(
2 name = "helpers", 4 name = "helpers",
3 testonly = True, 5 testonly = True,
@@ -12,7 +14,6 @@ cc_library(
12 size = "small", 14 size = "small",
13 srcs = [src], 15 srcs = [src],
14 copts = [ 16 copts = [
15 "-std=c99",
16 "-Wno-parentheses", 17 "-Wno-parentheses",
17 ], 18 ],
18 deps = [ 19 deps = [
@@ -21,6 +22,7 @@ cc_library(
21 "//c-toxcore/testing:misc_tools", 22 "//c-toxcore/testing:misc_tools",
22 "//c-toxcore/toxav", 23 "//c-toxcore/toxav",
23 "//c-toxcore/toxcore", 24 "//c-toxcore/toxcore",
25 "//c-toxcore/toxencryptsave",
24 "@check", 26 "@check",
25 ], 27 ],
26) for src in glob(["*_test.c"])] 28) for src in glob(["*_test.c"])]
diff --git a/other/BUILD b/other/BUILD
index 223f4355..beec2397 100644
--- a/other/BUILD
+++ b/other/BUILD
@@ -1,3 +1,5 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1cc_library( 3cc_library(
2 name = "monolith", 4 name = "monolith",
3 hdrs = ["monolith.h"], 5 hdrs = ["monolith.h"],
@@ -14,7 +16,7 @@ cc_library(
14 srcs = ["bootstrap_node_packets.c"], 16 srcs = ["bootstrap_node_packets.c"],
15 hdrs = ["bootstrap_node_packets.h"], 17 hdrs = ["bootstrap_node_packets.h"],
16 visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"], 18 visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"],
17 deps = ["//c-toxcore/toxcore"], 19 deps = ["//c-toxcore/toxcore:network"],
18) 20)
19 21
20cc_binary( 22cc_binary(
diff --git a/testing/BUILD b/testing/BUILD
index 9504af90..2a5c2896 100644
--- a/testing/BUILD
+++ b/testing/BUILD
@@ -1,3 +1,5 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1cc_library( 3cc_library(
2 name = "misc_tools", 4 name = "misc_tools",
3 hdrs = [ 5 hdrs = [
diff --git a/toxav/BUILD b/toxav/BUILD
index 43e7e0fc..7ebb16ad 100644
--- a/toxav/BUILD
+++ b/toxav/BUILD
@@ -1,41 +1,94 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1filegroup( 3filegroup(
2 name = "public", 4 name = "public_headers",
3 srcs = ["toxav.h"], 5 srcs = ["toxav.h"],
4 visibility = ["//visibility:public"], 6 visibility = ["//c-toxcore:__pkg__"],
5) 7)
6 8
7cc_library( 9cc_library(
8 name = "toxav", 10 name = "public",
11 hdrs = [":public_headers"],
12)
13
14cc_library(
15 name = "ring_buffer",
16 srcs = ["ring_buffer.c"],
17 hdrs = ["ring_buffer.h"],
18)
19
20cc_library(
21 name = "bwcontroller",
22 srcs = ["bwcontroller.c"],
23 hdrs = ["bwcontroller.h"],
24 deps = [
25 ":ring_buffer",
26 "//c-toxcore/toxcore:Messenger",
27 ],
28)
29
30cc_library(
31 name = "rtp",
32 srcs = ["rtp.c"],
33 hdrs = ["rtp.h"],
34 deps = [":bwcontroller"],
35)
36
37cc_library(
38 name = "audio",
39 srcs = ["audio.c"],
40 hdrs = ["audio.h"],
41 deps = [
42 ":public",
43 ":rtp",
44 "//c-toxcore/toxcore:network",
45 "@opus",
46 ],
47)
48
49cc_library(
50 name = "video",
9 srcs = [ 51 srcs = [
10 "audio.c",
11 "bwcontroller.c",
12 "groupav.c",
13 "msi.c", 52 "msi.c",
14 "ring_buffer.c",
15 "rtp.c",
16 "toxav.c",
17 "toxav_old.c",
18 "video.c", 53 "video.c",
19 ], 54 ],
20 hdrs = [ 55 hdrs = [
21 "audio.h",
22 "bwcontroller.h",
23 "groupav.h",
24 "msi.h", 56 "msi.h",
25 "ring_buffer.h",
26 "rtp.h",
27 "toxav.api.h",
28 "toxav.h",
29 "video.h", 57 "video.h",
30 ], 58 ],
31 copts = [ 59 deps = [
32 "-std=c99", 60 ":audio",
61 ":public",
62 "//c-toxcore/toxcore:network",
63 "@libvpx",
64 ],
65)
66
67cc_library(
68 name = "groupav",
69 srcs = ["groupav.c"],
70 hdrs = ["groupav.h"],
71 deps = [
72 "//c-toxcore/toxcore:group",
73 "@opus",
74 ],
75)
76
77cc_library(
78 name = "toxav",
79 srcs = [
80 "toxav.c",
81 "toxav_old.c",
82 ],
83 hdrs = [
84 "toxav.api.h",
85 "toxav.h",
33 ], 86 ],
34 visibility = ["//visibility:public"], 87 visibility = ["//visibility:public"],
35 deps = [ 88 deps = [
89 ":groupav",
90 ":video",
36 "//c-toxcore/toxcore", 91 "//c-toxcore/toxcore",
37 "@libvpx",
38 "@opus",
39 ], 92 ],
40) 93)
41 94
@@ -49,4 +102,9 @@ cc_library(
49 "//c-toxcore/other:__pkg__", 102 "//c-toxcore/other:__pkg__",
50 "//c-toxcore/testing:__pkg__", 103 "//c-toxcore/testing:__pkg__",
51 ], 104 ],
105 deps = [
106 "//c-toxcore/toxcore",
107 "@libvpx",
108 "@opus",
109 ],
52) 110)
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)
diff --git a/toxencryptsave/BUILD b/toxencryptsave/BUILD
index 6dfb67b1..bdb0031e 100644
--- a/toxencryptsave/BUILD
+++ b/toxencryptsave/BUILD
@@ -1,25 +1,24 @@
1load("//tools:no_undefined.bzl", "cc_library")
2
1filegroup( 3filegroup(
2 name = "public", 4 name = "public_headers",
3 srcs = ["toxencryptsave.h"], 5 srcs = ["toxencryptsave.h"],
4 visibility = ["//visibility:public"], 6 visibility = ["//c-toxcore:__pkg__"],
7)
8
9cc_library(
10 name = "defines",
11 hdrs = ["defines.h"],
12 visibility = ["//c-toxcore/toxcore:__pkg__"],
5) 13)
6 14
7cc_library( 15cc_library(
8 name = "toxencryptsave", 16 name = "toxencryptsave",
9 srcs = [ 17 srcs = ["toxencryptsave.c"],
10 "toxencryptsave.c", 18 hdrs = ["toxencryptsave.h"],
11 ], 19 visibility = ["//visibility:public"],
12 hdrs = [
13 "defines.h",
14 "toxencryptsave.h",
15 ],
16 copts = [
17 "-std=c99",
18 ],
19 visibility = [
20 "//visibility:public",
21 ],
22 deps = [ 20 deps = [
21 ":defines",
23 "//c-toxcore/toxcore:crypto_core", 22 "//c-toxcore/toxcore:crypto_core",
24 ], 23 ],
25) 24)
@@ -31,4 +30,5 @@ cc_library(
31 "*.h", 30 "*.h",
32 ]), 31 ]),
33 visibility = ["//c-toxcore/other:__pkg__"], 32 visibility = ["//c-toxcore/other:__pkg__"],
33 deps = ["//c-toxcore/toxcore:crypto_core"],
34) 34)