Skip to content

Commit f5f22a5

Browse files
committed
chore: Enable layering check in all c-toxcore build files.
1 parent ce4b01d commit f5f22a5

File tree

7 files changed

+68
-4
lines changed

7 files changed

+68
-4
lines changed

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@rules_cc//cc:defs.bzl", "cc_library")
22
load("//tools/project:build_defs.bzl", "project")
33

4+
package(features = ["layering_check"])
5+
46
project()
57

68
genrule(

auto_tests/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
22

3+
package(features = ["layering_check"])
4+
35
cc_library(
46
name = "check_compat",
57
testonly = True,
@@ -36,6 +38,20 @@ flaky_tests = {
3638
"//c-toxcore/toxav",
3739
"//c-toxcore/toxcore",
3840
"//c-toxcore/toxcore:DHT_srcs",
41+
"//c-toxcore/toxcore:Messenger",
42+
"//c-toxcore/toxcore:TCP_connection",
43+
"//c-toxcore/toxcore:ccompat",
44+
"//c-toxcore/toxcore:crypto_core",
45+
"//c-toxcore/toxcore:friend_connection",
46+
"//c-toxcore/toxcore:logger",
47+
"//c-toxcore/toxcore:mono_time",
48+
"//c-toxcore/toxcore:net_crypto",
49+
"//c-toxcore/toxcore:network",
50+
"//c-toxcore/toxcore:onion",
51+
"//c-toxcore/toxcore:onion_announce",
52+
"//c-toxcore/toxcore:onion_client",
3953
"//c-toxcore/toxencryptsave",
54+
"@libsodium",
55+
"@libvpx",
4056
],
4157
) for src in glob(["*_test.c"])]

other/BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
22
load("//tools:no_undefined.bzl", "cc_library")
33

4+
package(features = ["layering_check"])
5+
46
cc_library(
57
name = "bootstrap_node_packets",
68
srcs = ["bootstrap_node_packets.c"],
@@ -15,5 +17,11 @@ cc_binary(
1517
deps = [
1618
"//c-toxcore/testing:misc_tools",
1719
"//c-toxcore/toxcore",
20+
"//c-toxcore/toxcore:DHT",
21+
"//c-toxcore/toxcore:TCP_connection",
22+
"//c-toxcore/toxcore:friend_requests",
23+
"//c-toxcore/toxcore:logger",
24+
"//c-toxcore/toxcore:mono_time",
25+
"//c-toxcore/toxcore:network",
1826
],
1927
)

other/fun/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
22

3+
package(features = ["layering_check"])
4+
35
#cc_binary(
46
# name = "cracker",
57
# srcs = ["cracker.c"],
@@ -16,6 +18,7 @@ cc_binary(
1618
srcs = ["cracker_simple.c"],
1719
deps = [
1820
"//c-toxcore/testing:misc_tools",
21+
"//c-toxcore/toxcore:ccompat",
1922
"@libsodium",
2023
],
2124
)
@@ -24,6 +27,7 @@ cc_binary(
2427
name = "minimal-save-generator",
2528
srcs = ["minimal-save-generator.c"],
2629
deps = [
30+
"//c-toxcore/toxcore:ccompat",
2731
"@libsodium",
2832
],
2933
)
@@ -34,6 +38,7 @@ cc_binary(
3438
copts = ["-w"],
3539
deps = [
3640
"//c-toxcore/testing:misc_tools",
41+
"//c-toxcore/toxcore:ccompat",
3742
"@libsodium",
3843
],
3944
)
@@ -53,5 +58,6 @@ cc_binary(
5358
deps = [
5459
"//c-toxcore/testing:misc_tools",
5560
"//c-toxcore/toxcore",
61+
"//c-toxcore/toxcore:ccompat",
5662
],
5763
)

super_donators/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
22

3+
package(features = ["layering_check"])
4+
35
cc_binary(
46
name = "grencez_tok5",
57
srcs = ["grencez_tok5.c"],

toxcore/BUILD.bazel

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ cc_library(
6666
srcs = ["logger.c"],
6767
hdrs = ["logger.h"],
6868
visibility = [
69+
"//c-toxcore/auto_tests:__pkg__",
70+
"//c-toxcore/other:__pkg__",
6971
"//c-toxcore/other/bootstrap_daemon:__pkg__",
7072
"//c-toxcore/toxav:__pkg__",
7173
],
@@ -84,6 +86,8 @@ cc_library(
8486
srcs = ["mono_time.c"],
8587
hdrs = ["mono_time.h"],
8688
visibility = [
89+
"//c-toxcore/auto_tests:__pkg__",
90+
"//c-toxcore/other:__pkg__",
8791
"//c-toxcore/other/bootstrap_daemon:__pkg__",
8892
"//c-toxcore/testing:__pkg__",
8993
"//c-toxcore/toxav:__pkg__",
@@ -116,6 +120,7 @@ cc_library(
116120
"util.h",
117121
],
118122
visibility = [
123+
"//c-toxcore/auto_tests:__pkg__",
119124
"//c-toxcore/other:__pkg__",
120125
"//c-toxcore/other/bootstrap_daemon:__pkg__",
121126
"//c-toxcore/toxav:__pkg__",
@@ -190,6 +195,7 @@ cc_library(
190195
"ping.h",
191196
],
192197
visibility = [
198+
"//c-toxcore/other:__pkg__",
193199
"//c-toxcore/other/bootstrap_daemon:__pkg__",
194200
"//c-toxcore/testing:__pkg__",
195201
],
@@ -227,6 +233,7 @@ cc_library(
227233
],
228234
visibility = [
229235
"//c-toxcore/auto_tests:__pkg__",
236+
"//c-toxcore/other:__pkg__",
230237
"//c-toxcore/other/bootstrap_daemon:__pkg__",
231238
],
232239
deps = [
@@ -242,6 +249,7 @@ cc_library(
242249
name = "onion",
243250
srcs = ["onion.c"],
244251
hdrs = ["onion.h"],
252+
visibility = ["//c-toxcore/auto_tests:__pkg__"],
245253
deps = [
246254
":DHT",
247255
":crypto_core",
@@ -266,7 +274,11 @@ cc_library(
266274
"//tools/config:linux": ["-DTCP_SERVER_USE_EPOLL=1"],
267275
"//conditions:default": [],
268276
}),
269-
visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"],
277+
visibility = [
278+
"//c-toxcore/auto_tests:__pkg__",
279+
"//c-toxcore/other:__pkg__",
280+
"//c-toxcore/other/bootstrap_daemon:__pkg__",
281+
],
270282
deps = [
271283
":crypto_core",
272284
":list",
@@ -291,6 +303,7 @@ cc_library(
291303
name = "net_crypto",
292304
srcs = ["net_crypto.c"],
293305
hdrs = ["net_crypto.h"],
306+
visibility = ["//c-toxcore/auto_tests:__pkg__"],
294307
deps = [
295308
":DHT",
296309
":TCP_connection",
@@ -303,7 +316,10 @@ cc_library(
303316
name = "onion_announce",
304317
srcs = ["onion_announce.c"],
305318
hdrs = ["onion_announce.h"],
306-
visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"],
319+
visibility = [
320+
"//c-toxcore/auto_tests:__pkg__",
321+
"//c-toxcore/other/bootstrap_daemon:__pkg__",
322+
],
307323
deps = [
308324
":DHT",
309325
":mono_time",
@@ -316,6 +332,7 @@ cc_library(
316332
name = "onion_client",
317333
srcs = ["onion_client.c"],
318334
hdrs = ["onion_client.h"],
335+
visibility = ["//c-toxcore/auto_tests:__pkg__"],
319336
deps = [
320337
":DHT",
321338
":mono_time",
@@ -329,6 +346,7 @@ cc_library(
329346
name = "friend_connection",
330347
srcs = ["friend_connection.c"],
331348
hdrs = ["friend_connection.h"],
349+
visibility = ["//c-toxcore/auto_tests:__pkg__"],
332350
deps = [
333351
":DHT",
334352
":mono_time",
@@ -353,7 +371,11 @@ cc_library(
353371
name = "friend_requests",
354372
srcs = ["friend_requests.c"],
355373
hdrs = ["friend_requests.h"],
356-
visibility = ["//c-toxcore/testing:__pkg__"],
374+
visibility = [
375+
"//c-toxcore/auto_tests:__pkg__",
376+
"//c-toxcore/other:__pkg__",
377+
"//c-toxcore/testing:__pkg__",
378+
],
357379
deps = [
358380
":friend_connection",
359381
":network",
@@ -365,6 +387,7 @@ cc_library(
365387
srcs = ["Messenger.c"],
366388
hdrs = ["Messenger.h"],
367389
visibility = [
390+
"//c-toxcore/auto_tests:__pkg__",
368391
"//c-toxcore/testing:__pkg__",
369392
"//c-toxcore/toxav:__pkg__",
370393
],

toxencryptsave/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("//tools:no_undefined.bzl", "cc_library")
22

3+
package(features = ["layering_check"])
4+
35
filegroup(
46
name = "public_headers",
57
srcs = ["toxencryptsave.h"],
@@ -21,6 +23,7 @@ cc_library(
2123
":defines",
2224
"//c-toxcore/toxcore:ccompat",
2325
"//c-toxcore/toxcore:crypto_core",
26+
"@libsodium",
2427
],
2528
)
2629

@@ -31,7 +34,11 @@ cc_library(
3134
"*.h",
3235
]),
3336
visibility = ["//c-toxcore/other:__pkg__"],
34-
deps = ["//c-toxcore/toxcore:crypto_core"],
37+
deps = [
38+
"//c-toxcore/toxcore:ccompat",
39+
"//c-toxcore/toxcore:crypto_core",
40+
"@libsodium",
41+
],
3542
)
3643

3744
CIMPLE_SRCS = glob(

0 commit comments

Comments
 (0)