summaryrefslogtreecommitdiff
path: root/toxav/BUILD.bazel
blob: 79dbd12da1af3be1be2dc3e3d634690a5b9ce415 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
load("@rules_cc//cc:defs.bzl", "cc_test")
load("//tools:no_undefined.bzl", "cc_library")

filegroup(
    name = "public_headers",
    srcs = ["toxav.h"],
    visibility = ["//c-toxcore:__pkg__"],
)

cc_library(
    name = "public",
    hdrs = [":public_headers"],
)

cc_library(
    name = "ring_buffer",
    srcs = ["ring_buffer.c"],
    hdrs = ["ring_buffer.h"],
    deps = ["//c-toxcore/toxcore:ccompat"],
)

cc_test(
    name = "ring_buffer_test",
    size = "small",
    srcs = ["ring_buffer_test.cc"],
    deps = [
        ":ring_buffer",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "ring_buffer_srcs",
    hdrs = [
        "ring_buffer.c",
        "ring_buffer.h",
    ],
    visibility = ["//c-toxcore/testing:__pkg__"],
    deps = ["//c-toxcore/toxcore:ccompat"],
)

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

cc_library(
    name = "rtp",
    srcs = ["rtp.c"],
    hdrs = ["rtp.h"],
    deps = [":bwcontroller"],
)

cc_test(
    name = "rtp_test",
    size = "small",
    srcs = ["rtp_test.cc"],
    deps = [
        ":rtp",
        "//c-toxcore/toxcore:crypto_core",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "audio",
    srcs = ["audio.c"],
    hdrs = ["audio.h"],
    deps = [
        ":public",
        ":rtp",
        "//c-toxcore/toxcore:network",
        "@opus",
    ],
)

cc_library(
    name = "video",
    srcs = [
        "msi.c",
        "video.c",
    ],
    hdrs = [
        "msi.h",
        "video.h",
    ],
    deps = [
        ":audio",
        ":public",
        "//c-toxcore/toxcore:network",
        "@libvpx",
    ],
)

cc_library(
    name = "groupav",
    srcs = ["groupav.c"],
    hdrs = ["groupav.h"],
    deps = [
        "//c-toxcore/toxcore",
        "@opus",
    ],
)

cc_library(
    name = "toxav",
    srcs = [
        "toxav.c",
        "toxav_old.c",
    ],
    hdrs = [
        "toxav.api.h",
        "toxav.h",
    ],
    visibility = ["//c-toxcore:__subpackages__"],
    deps = [
        ":groupav",
        ":video",
    ],
)

CIMPLE_SRCS = glob(
    [
        "*.c",
        "*.h",
    ],
    exclude = [
        "*.api.h",
        "toxav.h",
    ],
)

sh_test(
    name = "cimple_test",
    size = "small",
    srcs = ["//hs-tokstyle/tools:check-cimple"],
    args = ["$(location %s)" % f for f in CIMPLE_SRCS],
    data = CIMPLE_SRCS,
    tags = ["manual"],
)