-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
89 lines (83 loc) · 2.62 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#CMake 最低版本号
cmake_minimum_required(VERSION 3.11.2)
project(ssxrver)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -g -lboost_thread -Wall -Wconversion -Wredundant-decls -Wcast-align -Wshadow -Werror -Wold-style-cast -march=native -pthread -Wno-unused-variable -fopenmp -L /usr/lib64/mysql -lmysqlclient -I /usr/include/mysql")
elseif( CMAKE_BUILD_TYPE STREQUAL "Release" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -o3 -lboost_thread -Wall -Wconversion -Wredundant-decls -Wcast-align -Wshadow -Werror -Wold-style-cast -march=native -pthread -Wno-unused-variable -fopenmp -L /usr/lib64/mysql -lmysqlclient -I /usr/include/mysql")
endif()
message("Build Type:" ${CMAKE_BUILD_TYPE} ${CMAKE_CXX_FLAGS})
include_directories(base)
include_directories(http)
include_directories(net)
include_directories(util)
add_executable(ssxrver
base/AsyncLogThread.cpp
base/AsyncLogThread.h
base/CurrentThread.h
base/Exception.cpp
base/Exception.h
base/File.cpp
base/File.h
base/LogFile.cpp
base/LogFile.h
base/Logging.cpp
base/Logging.h
base/LogStream.cpp
base/LogStream.h
base/Thread.cpp
base/Thread.h
base/ThreadSafeQueue.hpp
base/ThreadPool.cpp
base/ThreadPool.h
http/http11_common.h
http/http11_parser.cpp
http/http11_parser.h
http/httpclient_parser.cpp
http/httpclient_parser.h
http/HttpParser.cpp
http/HttpParser.h
http/HttpRequest.h
http/HttpResponse.cpp
http/HttpResponse.h
http/HttpServer.cpp
http/HttpServer.h
net/Buffer.cpp
net/Buffer.h
net/CallBacks.h
net/Channel.cpp
net/Channel.h
util/cJSON.c
util/cJSON.h
util/CJsonObject.cpp
util/CJsonObject.hpp
net/Epoll.cpp
net/Epoll.h
net/EventLoop.cpp
net/EventLoop.h
net/EventLoopThread.cpp
net/EventLoopThread.h
net/EventLoopThreadPool.cpp
net/EventLoopThreadPool.h
util/MySQL.cpp
util/MySQL.h
util/MySQLOps.cpp
util/MySQLOps.h
net/SocketOps.cpp
net/SocketOps.h
net/TcpConnection.cpp
net/TcpConnection.h
net/TcpServer.cpp
net/TcpServer.h
net/Timer.cpp
net/Timer.h
net/TimerManager.cpp
net/TimerManager.h
net/UdpServer.cpp
net/UdpServer.h
util/Init.cpp
util/Init.h
main.cpp)