From 57bd18ef88e48c18abf156b2635675df56c4a67e Mon Sep 17 00:00:00 2001 From: Trumeet Date: Sat, 22 Oct 2022 14:19:32 -0700 Subject: Use version number as TDLib config version --- CMakeLists.txt | 2 ++ config.h.in | 7 +++++++ tdutils.c | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index deede86..380cb42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(ksyxbot VERSION 1.0 LANGUAGES C CXX) set(CMAKE_C_STANDARD 99) +configure_file(config.h.in config.h) + IF (CMAKE_BUILD_TYPE MATCHES Debug) add_compile_definitions(TD_USE_ASAN) ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..ccae582 --- /dev/null +++ b/config.h.in @@ -0,0 +1,7 @@ +#ifndef BOT_CONFIG_H +#define BOT_CONFIG_H + +#define VER_MAJOR "@ksyxbot_VERSION_MAJOR@" +#define VER_MINOR "@ksyxbot_VERSION_MINOR@" + +#endif /* BOT_CONFIG_H */ \ No newline at end of file diff --git a/tdutils.c b/tdutils.c index 0df00c3..f9a5502 100644 --- a/tdutils.c +++ b/tdutils.c @@ -1,6 +1,7 @@ #include "tdutils.h" #include "botd.h" #include "log.h" +#include "config.h" #include #include @@ -252,7 +253,7 @@ static int handle_auth(const struct TdUpdateAuthorizationState *update) { "en", "Desktop", "0.0", - "Channel Helper Bot 1.0", + "ksyxbotd "VER_MAJOR"."VER_MINOR, false, true )), -- cgit v1.2.3