-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
58 lines (49 loc) · 1.94 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
cmake_minimum_required(VERSION 3.7)
PROJECT(quic-fiber)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -rdynamic -O0 -ggdb -g -std=c++17 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined")
#set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -std=c++17 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined")
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
include_directories("./" "./tests")
find_library(YAMLCPP yaml-cpp /usr/local/lib/)
find_library(THREAD pthread /usr/lib64/)
find_library(GTEST gtest /usr/local/lib64/)
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
set(LIBS ${PROJECT_NAME}
my_sylar
pthread
yaml-cpp
dl
gtest
#jemalloc
${OPENSSL_LIBRARIES}
)
set(LIB_SRC
quic-fiber/quic_type.cc
quic-fiber/quic_frame.cc
quic-fiber/quic_stream.cc
quic-fiber/quic_frame_sorter.cc
quic-fiber/quic_packet.cc
quic-fiber/quic_session.cc
quic-fiber/quic_packet_sorter.cc
quic-fiber/quic_utils.cc
quic-fiber/quic_server.cc
quic-fiber/quic_congestion.cc
quic-fiber/quic_flow_control.cc
)
add_library(${PROJECT_NAME} SHARED ${LIB_SRC})
function(quic_fiber_add_executable targetname srcs depends libs)
add_executable(${targetname} ${srcs})
add_dependencies(${targetname} ${depends})
#force_redefine_file_macro_for_source(${targetname})
target_link_libraries(${targetname} ${libs})
endfunction()
quic_fiber_add_executable(quic_server tests/server.cc ${PROJECT_NAME} "${LIBS}")
quic_fiber_add_executable(quic_client tests/client.cc ${PROJECT_NAME} "${LIBS}")
quic_fiber_add_executable(udp_rs tests/udp_rs.cc ${PROJECT_NAME} "${LIBS}")
quic_fiber_add_executable(semaphore_test tests/semaphore_test.cc ${PROJECT_NAME} "${LIBS}")