Skip to content

Commit

Permalink
chore: Enable compiler layering check.
Browse files Browse the repository at this point in the history
This ensures that we're explicit about what we depend on and avoids
transitive dependencies.
  • Loading branch information
iphydf committed Jan 11, 2022
1 parent eebc516 commit c1b32bd
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 12 deletions.
9 changes: 9 additions & 0 deletions other/bootstrap_daemon/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

package(features = ["layering_check"])

cc_binary(
name = "bootstrap_daemon",
srcs = glob([
Expand All @@ -9,6 +11,13 @@ cc_binary(
deps = [
"//c-toxcore/other:bootstrap_node_packets",
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:DHT",
"//c-toxcore/toxcore:TCP_connection",
"//c-toxcore/toxcore:ccompat",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
"//c-toxcore/toxcore:onion_announce",
"@libconfig",
],
)
16 changes: 13 additions & 3 deletions testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

package(features = ["layering_check"])

CIMPLE_FILES = [
"//c-toxcore/toxav:cimple_files",
"//c-toxcore/toxcore:cimple_files",
Expand All @@ -20,7 +22,11 @@ cc_library(
srcs = ["misc_tools.c"],
hdrs = ["misc_tools.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = ["//c-toxcore/toxcore"],
deps = [
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:ccompat",
"@libsodium",
],
)

cc_library(
Expand All @@ -35,7 +41,10 @@ cc_binary(
srcs = ["DHT_test.c"],
deps = [
":misc_tools",
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:DHT",
"//c-toxcore/toxcore:Messenger",
"//c-toxcore/toxcore:friend_requests",
"//c-toxcore/toxcore:mono_time",
],
)

Expand All @@ -44,7 +53,8 @@ cc_binary(
srcs = ["Messenger_test.c"],
deps = [
":misc_tools",
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:Messenger",
"//c-toxcore/toxcore:mono_time",
],
)

Expand Down
29 changes: 28 additions & 1 deletion toxav/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
load("@rules_cc//cc:defs.bzl", "cc_test")
load("//tools:no_undefined.bzl", "cc_library")

package(features = ["layering_check"])

filegroup(
name = "public_headers",
srcs = ["toxav.h"],
Expand All @@ -25,6 +27,7 @@ cc_test(
srcs = ["ring_buffer_test.cc"],
deps = [
":ring_buffer",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
Expand All @@ -47,14 +50,23 @@ cc_library(
":ring_buffer",
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:Messenger",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
],
)

cc_library(
name = "rtp",
srcs = ["rtp.c"],
hdrs = ["rtp.h"],
deps = [":bwcontroller"],
deps = [
":bwcontroller",
"//c-toxcore/toxcore:Messenger",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
],
)

cc_test(
Expand All @@ -64,6 +76,7 @@ cc_test(
deps = [
":rtp",
"//c-toxcore/toxcore:crypto_core",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
Expand All @@ -75,6 +88,8 @@ cc_library(
deps = [
":public",
":rtp",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
"@opus",
],
Expand All @@ -93,6 +108,10 @@ cc_library(
deps = [
":audio",
":public",
":ring_buffer",
":rtp",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
"@libvpx",
],
Expand All @@ -104,6 +123,9 @@ cc_library(
hdrs = ["groupav.h"],
deps = [
"//c-toxcore/toxcore",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
"@opus",
],
)
Expand All @@ -120,7 +142,12 @@ cc_library(
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":groupav",
":rtp",
":video",
"//c-toxcore/toxcore:Messenger",
"//c-toxcore/toxcore:logger",
"//c-toxcore/toxcore:mono_time",
"//c-toxcore/toxcore:network",
],
)

Expand Down
Loading

0 comments on commit c1b32bd

Please sign in to comment.