-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
92 lines (73 loc) · 2.1 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
cmake_minimum_required(VERSION 2.8.11)
cmake_policy(SET CMP0003 NEW)
project(quicrq C CXX)
find_package (Threads REQUIRED)
FIND_PACKAGE(PkgConfig REQUIRED)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-std=c99 -Wall -Werror -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
if(DISABLE_DEBUG_PRINTF)
set(CMAKE_C_FLAGS "-DDISABLE_DEBUG_PRINTF ${CMAKE_C_FLAGS}")
endif()
set(FUZI_Q_LIBRARY_FILES
lib/fuzzer.c
lib/fuzzer_frames.c
lib/client.c
lib/server.c
lib/context.c
)
set(FUZI_QTEST_LIBRARY_FILES
tests/basic_test.c
tests/context_tests.c
)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Picoquic REQUIRED)
message(STATUS "Picoquic/include: ${Picoquic_INCLUDE_DIRS}" )
message(STATUS "Picohttp library: ${Picoquic_LIBRARIES}" )
find_package(PTLS REQUIRED)
message(STATUS "picotls/include: ${PTLS_INCLUDE_DIRS}" )
message(STATUS "picotls libraries: ${PTLS_LIBRARIES}" )
find_package(OpenSSL REQUIRED)
message(STATUS "root: ${OPENSSL_ROOT_DIR}")
message(STATUS "OpenSSL_VERSION: ${OPENSSL_VERSION}")
message(STATUS "OpenSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message(STATUS "OpenSSL_LIBRARIES: ${OPENSSL_LIBRARIES}")
include_directories(include lib tests
${Picoquic_INCLUDE_DIRS} ${PTLS_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
add_library(fuzy_q_core ${FUZI_Q_LIBRARY_FILES} )
add_library(fuzi_q_tests
${FUZI_QTEST_LIBRARY_FILES}
)
add_executable(fuzi_q
src/fuzi_q.c
)
target_link_libraries(fuzi_q
fuzy_q_core
${Picoquic_LIBRARIES}
${PTLS_LIBRARIES}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
)
add_executable(fuzi_qt
src/fuzi_qt.c
)
target_link_libraries(fuzi_qt
fuzi_q_tests
fuzy_q_core
${Picoquic_LIBRARIES}
${PTLS_LIBRARIES}
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
)
set(TEST_EXES fuzi_qt)
# 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}
)