forked from private-octopus/picoquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
117 lines (99 loc) · 3.03 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
CMAKE_POLICY(SET CMP0003 NEW)
PROJECT(picoquic)
SET(CMAKE_C_STANDARD 11)
# FIND_PACKAGE(PkgConfig REQUIRED)
SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
if(${DISABLE_DEBUG_PRINTF})
SET(CMAKE_C_FLAGS "-DDISABLE_DEBUG_PRINTF ${CMAKE_C_FLAGS}")
endif()
INCLUDE_DIRECTORIES(picoquic picoquictest ../picotls/include
${PICOTLS_INCLUDE_DIR})
SET(PICOQUIC_LIBRARY_FILES
picoquic/fnv1a.c
picoquic/frames.c
picoquic/http0dot9.c
picoquic/intformat.c
picoquic/logger.c
picoquic/newreno.c
picoquic/packet.c
picoquic/picohash.c
picoquic/picosocks.c
picoquic/picosplay.c
picoquic/quicctx.c
picoquic/sacks.c
picoquic/sender.c
picoquic/spinbit.c
picoquic/ticket_store.c
picoquic/tls_api.c
picoquic/transport.c
picoquic/util.c
)
SET(PICOQUIC_TEST_LIBRARY_FILES
picoquictest/ack_of_ack_test.c
picoquictest/cleartext_aead_test.c
picoquictest/cnx_creation_test.c
picoquictest/float16test.c
picoquictest/fnv1atest.c
picoquictest/hashtest.c
picoquictest/http0dot9test.c
picoquictest/intformattest.c
picoquictest/parseheadertest.c
picoquictest/pn2pn64test.c
picoquictest/sacktest.c
picoquictest/skip_frame_test.c
picoquictest/sim_link.c
picoquictest/socket_test.c
picoquictest/splay_test.c
picoquictest/stream0_frame_test.c
picoquictest/stresstest.c
picoquictest/ticket_store_test.c
picoquictest/tls_api_test.c
picoquictest/transport_param_test.c
)
FIND_LIBRARY(PTLS_CORE picotls-core PATH ../picotls)
MESSAGE(STATUS "Found picotls-core at : ${PTLS_CORE} " )
FIND_LIBRARY(PTLS_MINICRYPTO picotls-minicrypto PATH ../picotls)
MESSAGE(STATUS "Found picotls-crypto at : ${PTLS_MINICRYPTO} " )
FIND_LIBRARY(PTLS_OPENSSL picotls-openssl PATH ../picotls)
MESSAGE(STATUS "Found picotls-openssl at : ${PTLS_OPENSSL} " )
FIND_PACKAGE(OpenSSL )
MESSAGE("root: ${OPENSSL_ROOT_DIR}")
MESSAGE("OpenSSL_VERSION: ${OPENSSL_VERSION}")
MESSAGE("OpenSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
MESSAGE("OpenSSL_LIBRARIES: ${OPENSSL_LIBRARIES}")
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
ADD_LIBRARY(picoquic-core
${PICOQUIC_LIBRARY_FILES}
)
ADD_EXECUTABLE(picoquicdemo picoquicfirst/picoquicdemo.c
picoquicfirst/getopt.c )
TARGET_LINK_LIBRARIES(picoquicdemo picoquic-core
${PTLS_CORE}
${PTLS_OPENSSL}
${PTLS_MINICRYPTO}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
)
ADD_EXECUTABLE(picoquic_ct picoquic_t/picoquic_t.c
${PICOQUIC_TEST_LIBRARY_FILES} )
TARGET_LINK_LIBRARIES(picoquic_ct picoquic-core
${PTLS_CORE}
${PTLS_OPENSSL}
${PTLS_MINICRYPTO}
${PTLS_OPENSSL}
${PTLS_CORE}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
)
SET(TEST_EXES picoquic_ct)
# get all project files for formatting
file(GLOB_RECURSE CLANG_FORMAT_SOURCE_FILES *.c *.h)
# Adds clangformat as target that formats all source files
add_custom_target(
clangformat
COMMAND clang-format
-style=Webkit
-i
${CLANG_FORMAT_SOURCE_FILES}
)