forked from ammarfaizi2/tgvisd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (61 loc) · 1.72 KB
/
CMakeLists.txt
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
# SPDX-License-Identifier: GPL-2.0
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(TeaBot VERSION 8.3 LANGUAGES C CXX)
find_package(Td 1.7.5 REQUIRED)
include_directories(src)
include_directories(src/ext)
include_directories(src/ext/mysql_cpp/include)
link_directories(src/ext/mysql_cpp/build)
# TD core (low level)
set(TGVISD_TD_SOURCE
src/tgvisd/Td/Callback.hpp
src/tgvisd/Td/Td.hpp
src/tgvisd/Td/Td.cpp
)
# tgvisd core
set(TGVISD_CORE_SOURCE
src/tgvisd/DBFunc/DBStatement.cpp
src/tgvisd/DBFunc/DBStatement.hpp
src/tgvisd/Scrapers/ChatScraper.cpp
src/tgvisd/Scrapers/ChatScraper.hpp
src/tgvisd/common.hpp
src/tgvisd/DB.cpp
src/tgvisd/DB.hpp
src/tgvisd/DBCommon.hpp
src/tgvisd/entry.cpp
src/tgvisd/Main.cpp
src/tgvisd/Main.hpp
src/tgvisd/print.c
src/tgvisd/print.h
src/tgvisd/Scraper.cpp
src/tgvisd/Scraper.hpp
)
# Build the shared library that contains tdlib core.
add_library(tgvisd-td SHARED ${TGVISD_TD_SOURCE})
set_property(TARGET tgvisd-td PROPERTY CXX_STANDARD 20)
target_link_libraries(tgvisd-td PRIVATE Td::TdStatic)
target_include_directories(tgvisd-td PRIVATE td/include)
target_compile_options(tgvisd-td PRIVATE
-ggdb3
-Wall
-Wextra
-Wpedantic
-Wno-unused-parameter
-fno-omit-frame-pointer
-fstack-protector-strong
)
## Build the main binary (static)
add_executable(tgvisd ${TGVISD_CORE_SOURCE})
set_property(TARGET tgvisd PROPERTY CXX_STANDARD 20)
set_property(TARGET tgvisd PROPERTY C_STANDARD 11)
target_link_libraries(tgvisd tgvisd-td pthread curl mysqlcppconn8)
target_include_directories(tgvisd PRIVATE td/include)
target_compile_options(tgvisd PRIVATE
-ggdb3
-Wall
-Wextra
-Wpedantic
-Wno-unused-parameter
-fno-omit-frame-pointer
-fstack-protector-strong
)