diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000..7a20354 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,26 @@ +cc_binary( + name = "toxic", + srcs = glob([ + "src/*.c", + "src/*.h", + ]), + copts = [ + "-DAUDIO", + "-DPACKAGE_DATADIR='\"data\"'", + "-DPYTHON", + "-DVIDEO", + ], + linkopts = [ + "-lconfig", + "-lncurses", + "-lopenal", + "-lX11", + ], + deps = [ + "//c-toxcore", + "@curl", + "@libqrencode", + "@libvpx", + "@python3//:python", + ], +) diff --git a/Makefile b/Makefile index 4221485..83d44be 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CFG_DIR = $(BASE_DIR)/cfg -include $(CFG_DIR)/global_vars.mk -LIBS = toxcore ncursesw libconfig +LIBS = toxcore ncursesw libconfig libqrencode CFLAGS = -std=gnu99 -pthread -Wall -g -fstack-protector-all CFLAGS += '-DTOXICVER="$(VERSION)"' -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64 diff --git a/src/audio_call.c b/src/audio_call.c index 87a9150..b2b7929 100644 --- a/src/audio_call.c +++ b/src/audio_call.c @@ -31,6 +31,8 @@ #include "friendlist.h" #include "chat.h" +#ifdef AUDIO + #ifdef VIDEO #include "video_call.h" #endif /* VIDEO */ @@ -862,7 +864,7 @@ void cmd_bitrate(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv) break; case TOXAV_ERR_BIT_RATE_SET_INVALID_BIT_RATE: - error_str = "Invalid AV bit rate value (valid is 6-510)"; + error_str = "Invalid audio bit rate value (valid is 6-510)"; break; case TOXAV_ERR_BIT_RATE_SET_FRIEND_NOT_FOUND: @@ -942,3 +944,5 @@ void del_friend_AV(uint32_t index) realloc_calls(index); CallControl.max_calls = index; } + +#endif diff --git a/src/video_call.c b/src/video_call.c index f46e037..6b30df7 100644 --- a/src/video_call.c +++ b/src/video_call.c @@ -37,6 +37,8 @@ #include #include +#ifdef VIDEO + #define default_video_bit_rate 5000 void receive_video_frame_cb( ToxAV *av, uint32_t friend_number, @@ -422,3 +424,5 @@ void stop_video_stream(ToxWindow *self) if (this_call && this_call->vin_idx != -1) stop_video_transmission(this_call, self->num); } + +#endif diff --git a/src/video_device.c b/src/video_device.c index 89fa33d..e899735 100644 --- a/src/video_device.c +++ b/src/video_device.c @@ -55,6 +55,8 @@ #include #include +#ifdef VIDEO + #define inline__ inline __attribute__((always_inline)) extern struct user_settings *user_settings; @@ -96,9 +98,7 @@ static int size[2]; /* Size of above containers */ VideoDevice *video_devices_running[2][MAX_DEVICES] = {{NULL}}; /* Running devices */ uint32_t primary_video_device[2]; /* Primary device */ -#ifdef VIDEO static ToxAV *av = NULL; -#endif /* VIDEO */ /* q_mutex */ #define lock pthread_mutex_lock(&video_mutex); @@ -827,3 +827,5 @@ VideoDeviceError video_selection_valid(VideoDeviceType type, int32_t selection) { return (size[type] <= selection || selection < 0) ? vde_InvalidSelection : vde_None; } + +#endif /* VIDEO */