From 1cecb6c87a4d1c9773d6861868124a9d0f01f7b2 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 21 Jan 2018 01:05:23 +0000 Subject: [PATCH] Add BUILD files for all the little tools in the repo. Also, fix av_test.c, since I broke it last time. --- other/BUILD | 17 +++++++++++++++++ other/bootstrap_daemon/BUILD | 12 ++++++++++++ other/fun/BUILD | 27 +++++++++++++++++++++++++++ super_donators/BUILD | 4 ++++ testing/BUILD | 15 +++++++++++++++ testing/av_test.c | 12 +++++++++--- toxav/BUILD | 5 ++++- 7 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 other/bootstrap_daemon/BUILD create mode 100644 other/fun/BUILD create mode 100644 super_donators/BUILD diff --git a/other/BUILD b/other/BUILD index 5c8997ec..223f4355 100644 --- a/other/BUILD +++ b/other/BUILD @@ -8,3 +8,20 @@ cc_library( "//c-toxcore/toxencryptsave:monolith", ], ) + +cc_library( + name = "bootstrap_node_packets", + srcs = ["bootstrap_node_packets.c"], + hdrs = ["bootstrap_node_packets.h"], + visibility = ["//c-toxcore/other/bootstrap_daemon:__pkg__"], + deps = ["//c-toxcore/toxcore"], +) + +cc_binary( + name = "DHT_bootstrap", + srcs = ["DHT_bootstrap.c"], + deps = [ + "//c-toxcore/testing:misc_tools", + "//c-toxcore/toxcore", + ], +) diff --git a/other/bootstrap_daemon/BUILD b/other/bootstrap_daemon/BUILD new file mode 100644 index 00000000..d4a6bd2e --- /dev/null +++ b/other/bootstrap_daemon/BUILD @@ -0,0 +1,12 @@ +cc_binary( + name = "bootstrap_daemon", + srcs = glob([ + "src/*.c", + "src/*.h", + ]), + linkopts = ["-lconfig"], + deps = [ + "//c-toxcore/other:bootstrap_node_packets", + "//c-toxcore/toxcore", + ], +) diff --git a/other/fun/BUILD b/other/fun/BUILD new file mode 100644 index 00000000..c3ab510e --- /dev/null +++ b/other/fun/BUILD @@ -0,0 +1,27 @@ +cc_binary( + name = "cracker", + srcs = ["cracker.c"], + deps = [ + "//c-toxcore/testing:misc_tools", + "@libsodium", + ], +) + +cc_binary( + name = "sign", + srcs = ["sign.c"], + deps = [ + "//c-toxcore/testing:misc_tools", + "@libsodium", + ], + copts = ["-w"], +) + +cc_binary( + name = "strkey", + srcs = ["strkey.c"], + deps = [ + "@libsodium", + ], + copts = ["-w"], +) diff --git a/super_donators/BUILD b/super_donators/BUILD new file mode 100644 index 00000000..85629756 --- /dev/null +++ b/super_donators/BUILD @@ -0,0 +1,4 @@ +cc_binary( + name = "grencez_tok5", + srcs = ["grencez_tok5.c"], +) diff --git a/testing/BUILD b/testing/BUILD index 76f3db04..9504af90 100644 --- a/testing/BUILD +++ b/testing/BUILD @@ -24,6 +24,21 @@ cc_binary( ], ) +cc_binary( + name = "av_test", + srcs = ["av_test.c"], + linkopts = [ + "-lportaudio", + "-lopencv_highgui", + "-lopencv_core", + ], + deps = [ + "//c-toxcore/toxav", + "//c-toxcore/toxav:monolith", + "//c-toxcore/toxcore", + ], +) + cc_binary( name = "irc_syncbot", srcs = ["irc_syncbot.c"], diff --git a/testing/av_test.c b/testing/av_test.c index d6c880c5..71836a52 100644 --- a/testing/av_test.c +++ b/testing/av_test.c @@ -241,15 +241,15 @@ static void initialize_tox(Tox **bootstrap, ToxAV **AliceAV, CallControl *AliceC TOX_ERR_NEW error; tox_options_set_start_port(opts, 33445); - *bootstrap = tox_new(&opts, &error); + *bootstrap = tox_new(opts, &error); assert(error == TOX_ERR_NEW_OK); tox_options_set_start_port(opts, 33455); - Alice = tox_new(&opts, &error); + Alice = tox_new(opts, &error); assert(error == TOX_ERR_NEW_OK); tox_options_set_start_port(opts, 33465); - Bob = tox_new(&opts, &error); + Bob = tox_new(opts, &error); assert(error == TOX_ERR_NEW_OK); } @@ -440,8 +440,10 @@ int main(int argc, char **argv) long audio_out_dev_idx = -1; int32_t audio_frame_duration = 20; +#if 0 // TODO(mannol): Put this to use. int32_t video_frame_duration = 10; +#endif /* Parse settings */ CHECK_ARG: @@ -467,6 +469,8 @@ CHECK_ARG: vf_name = optarg; goto CHECK_ARG; +#if 0 + case 'x': { char *d; video_frame_duration = strtol(optarg, &d, 10); @@ -479,6 +483,8 @@ CHECK_ARG: goto CHECK_ARG; } +#endif + case 'o': { char *d; audio_out_dev_idx = strtol(optarg, &d, 10); diff --git a/toxav/BUILD b/toxav/BUILD index 81178f99..43e7e0fc 100644 --- a/toxav/BUILD +++ b/toxav/BUILD @@ -45,5 +45,8 @@ cc_library( "*.c", "*.h", ]), - visibility = ["//c-toxcore/other:__pkg__"], + visibility = [ + "//c-toxcore/other:__pkg__", + "//c-toxcore/testing:__pkg__", + ], )