-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
40 lines (31 loc) · 1.26 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
cmake_minimum_required(VERSION 3.15)
project(tlgs)
option(TLGS_BUILD_TESTS "Build TLGS tests" ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# include(CheckCXXCompilerFlag)
# check_cxx_compiler_flag("-fstack-protector-strong" HAVE_FSTACK_PROTECTOR)
# if(HAVE_FSTACK_PROTECTOR)
# message(STATUS "Stack protector enabled")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
# endif()
set(DREMINI_BUILD_EXAMPLES OFF)
set(DREMINI_BUILD_TEST OFF)
set(SPARTOI_BUILD_EXAMPLES OFF)
# Enable tail call optimization so coroutines doesn't blow up the stack
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -foptimize-sibling-calls")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(thrid_party/landlock-unveil)
include_directories(thrid_party/landlock-unveil)
endif()
add_subdirectory(thrid_party/dremini)
include_directories(thrid_party/dremini)
add_subdirectory(thrid_party/spartoi)
include_directories(thrid_party/spartoi)
find_package(Drogon REQUIRED)
include_directories(.)
add_subdirectory(tlgsutils)
add_subdirectory(tlgs)
install(FILES systemd/tlgs_crawler.service systemd/tlgs_crawler.timer systemd/tlgs_server.service DESTINATION /etc/systemd/)
install(FILES systemd/tlgs.conf DESTINATION lib/sysuser.d)
include(Package.cmake)