2018-01-22 00:58:32 +08:00
|
|
|
load("//tools:no_undefined.bzl", "cc_library")
|
|
|
|
|
2018-01-18 23:14:50 +08:00
|
|
|
filegroup(
|
2018-01-22 00:58:32 +08:00
|
|
|
name = "public_headers",
|
2018-01-18 23:14:50 +08:00
|
|
|
srcs = ["tox.h"],
|
2018-01-22 00:58:32 +08:00
|
|
|
visibility = ["//c-toxcore:__pkg__"],
|
2018-01-18 23:14:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "ccompat",
|
2018-01-22 00:58:32 +08:00
|
|
|
hdrs = ["ccompat.h"],
|
2018-01-29 05:30:39 +08:00
|
|
|
visibility = ["//c-toxcore:__subpackages__"],
|
2018-01-18 23:14:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "crypto_core",
|
|
|
|
srcs = [
|
|
|
|
"crypto_core.c",
|
|
|
|
"crypto_core_mem.c",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"crypto_core.h",
|
|
|
|
],
|
2018-01-22 06:38:08 +08:00
|
|
|
visibility = ["//c-toxcore:__subpackages__"],
|
2018-01-18 23:14:50 +08:00
|
|
|
deps = [
|
|
|
|
":ccompat",
|
|
|
|
"@libsodium",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-02-04 00:13:22 +08:00
|
|
|
cc_test(
|
|
|
|
name = "crypto_core_test",
|
2018-09-23 06:53:35 +08:00
|
|
|
size = "small",
|
2018-06-23 20:32:41 +08:00
|
|
|
srcs = ["crypto_core_test.cc"],
|
2018-02-04 00:13:22 +08:00
|
|
|
deps = [
|
|
|
|
":crypto_core",
|
2018-01-20 05:59:42 +08:00
|
|
|
"@com_google_googletest//:gtest_main",
|
2018-02-04 00:13:22 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-18 23:14:50 +08:00
|
|
|
cc_library(
|
2018-01-22 00:58:32 +08:00
|
|
|
name = "list",
|
|
|
|
srcs = ["list.c"],
|
|
|
|
hdrs = ["list.h"],
|
2018-01-29 05:30:39 +08:00
|
|
|
deps = [":ccompat"],
|
2018-01-22 00:58:32 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "logger",
|
|
|
|
srcs = ["logger.c"],
|
|
|
|
hdrs = ["logger.h"],
|
2018-02-23 10:22:38 +08:00
|
|
|
deps = [":ccompat"],
|
2018-01-22 00:58:32 +08:00
|
|
|
)
|
|
|
|
|
2018-07-09 21:40:36 +08:00
|
|
|
cc_library(
|
|
|
|
name = "state",
|
|
|
|
srcs = ["state.c"],
|
|
|
|
hdrs = ["state.h"],
|
|
|
|
deps = [":logger"],
|
|
|
|
)
|
|
|
|
|
2018-07-08 16:43:42 +08:00
|
|
|
cc_library(
|
|
|
|
name = "mono_time",
|
|
|
|
srcs = ["mono_time.c"],
|
|
|
|
hdrs = ["mono_time.h"],
|
|
|
|
deps = [":ccompat"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "mono_time_test",
|
2018-09-23 06:53:35 +08:00
|
|
|
size = "small",
|
2018-07-08 16:43:42 +08:00
|
|
|
srcs = ["mono_time_test.cc"],
|
|
|
|
deps = [
|
|
|
|
":mono_time",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-22 00:58:32 +08:00
|
|
|
cc_library(
|
|
|
|
name = "network",
|
|
|
|
srcs = [
|
|
|
|
"network.c",
|
|
|
|
"util.c",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"network.h",
|
|
|
|
"util.h",
|
|
|
|
],
|
|
|
|
visibility = [
|
|
|
|
"//c-toxcore/other:__pkg__",
|
|
|
|
"//c-toxcore/toxav:__pkg__",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":ccompat",
|
|
|
|
":crypto_core",
|
|
|
|
":logger",
|
2018-07-08 16:43:42 +08:00
|
|
|
":mono_time",
|
2018-09-22 20:25:37 +08:00
|
|
|
"@psocket",
|
|
|
|
"@pthread",
|
2018-01-22 00:58:32 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-02-03 23:44:43 +08:00
|
|
|
cc_test(
|
|
|
|
name = "util_test",
|
2018-09-23 06:53:35 +08:00
|
|
|
size = "small",
|
2018-06-23 20:32:41 +08:00
|
|
|
srcs = ["util_test.cc"],
|
2018-02-03 23:44:43 +08:00
|
|
|
deps = [
|
|
|
|
":network",
|
2018-01-20 05:59:42 +08:00
|
|
|
"@com_google_googletest//:gtest_main",
|
2018-02-03 23:44:43 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-22 00:58:32 +08:00
|
|
|
cc_library(
|
|
|
|
name = "ping_array",
|
|
|
|
srcs = ["ping_array.c"],
|
|
|
|
hdrs = ["ping_array.h"],
|
|
|
|
deps = [":network"],
|
|
|
|
)
|
|
|
|
|
2018-08-26 17:42:08 +08:00
|
|
|
cc_test(
|
|
|
|
name = "ping_array_test",
|
2018-09-23 06:53:35 +08:00
|
|
|
size = "small",
|
2018-08-26 17:42:08 +08:00
|
|
|
srcs = ["ping_array_test.cc"],
|
|
|
|
deps = [
|
|
|
|
":ping_array",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-22 00:58:32 +08:00
|
|
|
cc_library(
|
|
|
|
name = "DHT",
|
2018-01-18 23:14:50 +08:00
|
|
|
srcs = [
|
|
|
|
"DHT.c",
|
|
|
|
"LAN_discovery.c",
|
2018-01-22 00:58:32 +08:00
|
|
|
"ping.c",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"DHT.h",
|
2018-01-18 23:14:50 +08:00
|
|
|
"LAN_discovery.h",
|
2018-01-22 00:58:32 +08:00
|
|
|
"ping.h",
|
|
|
|
],
|
|
|
|
visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"],
|
|
|
|
deps = [
|
|
|
|
":crypto_core",
|
|
|
|
":logger",
|
|
|
|
":ping_array",
|
2018-07-09 21:40:36 +08:00
|
|
|
":state",
|
2018-01-22 00:58:32 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-07-17 09:18:04 +08:00
|
|
|
cc_library(
|
|
|
|
name = "DHT_srcs",
|
|
|
|
hdrs = [
|
|
|
|
"DHT.c",
|
|
|
|
"DHT.h",
|
|
|
|
"LAN_discovery.c",
|
|
|
|
"LAN_discovery.h",
|
|
|
|
"ping.c",
|
|
|
|
"ping.h",
|
|
|
|
],
|
|
|
|
visibility = [
|
|
|
|
"//c-toxcore/auto_tests:__pkg__",
|
|
|
|
"//c-toxcore/other/bootstrap_daemon:__pkg__",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":logger",
|
|
|
|
":ping_array",
|
|
|
|
":state",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-01-22 00:58:32 +08:00
|
|
|
cc_library(
|
|
|
|
name = "onion",
|
|
|
|
srcs = ["onion.c"],
|
|
|
|
hdrs = ["onion.h"],
|
|
|
|
deps = [":DHT"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TCP_connection",
|
|
|
|
srcs = [
|
2018-01-18 23:14:50 +08:00
|
|
|
"TCP_client.c",
|
|
|
|
"TCP_connection.c",
|
|
|
|
"TCP_server.c",
|
2018-01-22 00:58:32 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"TCP_client.h",
|
|
|
|
"TCP_connection.h",
|
2018-01-18 23:14:50 +08:00
|
|
|
"TCP_server.h",
|
2018-01-22 00:58:32 +08:00
|
|
|
],
|
2018-06-05 06:34:01 +08:00
|
|
|
copts = select({
|
|
|
|
"//tools/config:linux": ["-DTCP_SERVER_USE_EPOLL=1"],
|
2018-09-22 20:25:37 +08:00
|
|
|
"//conditions:default": [],
|
2018-06-05 06:34:01 +08:00
|
|
|
}),
|
2018-01-22 00:58:32 +08:00
|
|
|
deps = [
|
|
|
|
":crypto_core",
|
|
|
|
":list",
|
|
|
|
":onion",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "net_crypto",
|
|
|
|
srcs = ["net_crypto.c"],
|
|
|
|
hdrs = ["net_crypto.h"],
|
|
|
|
deps = [
|
|
|
|
":DHT",
|
|
|
|
":TCP_connection",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "onion_announce",
|
|
|
|
srcs = ["onion_announce.c"],
|
|
|
|
hdrs = ["onion_announce.h"],
|
|
|
|
deps = [":onion"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "onion_client",
|
|
|
|
srcs = ["onion_client.c"],
|
|
|
|
hdrs = ["onion_client.h"],
|
|
|
|
deps = [
|
|
|
|
":net_crypto",
|
|
|
|
":onion_announce",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "friend_connection",
|
|
|
|
srcs = ["friend_connection.c"],
|
|
|
|
hdrs = ["friend_connection.h"],
|
|
|
|
deps = [
|
|
|
|
":DHT",
|
|
|
|
":net_crypto",
|
|
|
|
":onion_client",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "friend_requests",
|
|
|
|
srcs = ["friend_requests.c"],
|
|
|
|
hdrs = ["friend_requests.h"],
|
|
|
|
deps = [":friend_connection"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "Messenger",
|
|
|
|
srcs = ["Messenger.c"],
|
|
|
|
hdrs = ["Messenger.h"],
|
|
|
|
visibility = ["//c-toxcore/toxav:__pkg__"],
|
2018-07-09 21:40:36 +08:00
|
|
|
deps = [
|
|
|
|
":friend_requests",
|
|
|
|
":state",
|
|
|
|
],
|
2018-01-22 00:58:32 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "group",
|
|
|
|
srcs = ["group.c"],
|
|
|
|
hdrs = ["group.h"],
|
|
|
|
visibility = ["//c-toxcore/toxav:__pkg__"],
|
|
|
|
deps = [":Messenger"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "toxcore",
|
|
|
|
srcs = [
|
2018-01-18 23:14:50 +08:00
|
|
|
"tox.c",
|
|
|
|
"tox.h",
|
|
|
|
"tox_api.c",
|
|
|
|
],
|
2018-01-23 03:34:52 +08:00
|
|
|
visibility = ["//c-toxcore:__subpackages__"],
|
2018-01-18 23:14:50 +08:00
|
|
|
deps = [
|
2018-01-22 00:58:32 +08:00
|
|
|
":group",
|
|
|
|
"//c-toxcore/toxencryptsave:defines",
|
2018-01-18 23:14:50 +08:00
|
|
|
],
|
|
|
|
)
|