This repository has been archived by the owner on Feb 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
184 lines (160 loc) · 3.16 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#
# CMakeLists.txt
#
# Copyright (C) 2010 - 2022 Alfred E. Heggestad
#
##############################################################################
#
# Versioning
#
cmake_minimum_required(VERSION 3.13)
project(retest C)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
##############################################################################
#
# Module/Package Includes
#
find_package(RE REQUIRED)
##############################################################################
#
# Compile options/definitions
#
option(USE_SANITIZER "Sanitizers like: address, thread, undefined, memory")
include(sanitizer)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_BUILD_TYPE Debug)
if(MSVC)
add_compile_options("/W3")
else()
add_compile_options(
-Wall
-Wbad-function-cast
-Wcast-align
-Wextra
-Wmissing-declarations
-Wmissing-prototypes
-Wnested-externs
-Wold-style-definition
-Wshadow -Waggregate-return
-Wstrict-prototypes
-Wvla
)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wshorten-64-to-32)
endif()
include_directories(
src
${RE_INCLUDE_DIRS}
)
find_package(re CONFIG REQUIRED HINTS ../re/cmake)
##############################################################################
#
# Source/Header section
#
set(SRCS
src/aac.c
src/aes.c
src/aubuf.c
src/aulevel.c
src/auresamp.c
src/async.c
src/av1.c
src/base64.c
src/bfcp.c
src/conf.c
src/convert.c
src/crc32.c
src/dns.c
src/dsp.c
src/dtmf.c
src/fir.c
src/fmt.c
src/g711.c
src/h264.c
src/h265.c
src/hash.c
src/hmac.c
src/http.c
src/httpauth.c
src/ice.c
src/jbuf.c
src/json.c
src/list.c
src/main.c
src/mbuf.c
src/md5.c
src/mem.c
src/mock/dnssrv.c
src/mock/fuzz.c
src/mock/nat.c
src/mock/pf.c
src/mock/sipsrv.c
src/mock/stunsrv.c
src/mock/tcpsrv.c
src/mock/turnsrv.c
src/mqueue.c
src/net.c
src/odict.c
src/pcp.c
src/remain.c
src/rtcp.c
src/rtmp.c
src/rtp.c
src/rtpext.c
src/sa.c
src/sdp.c
src/sha.c
src/sip.c
src/sipauth.c
src/sipevent.c
src/sipreg.c
src/sipsess.c
src/srtp.c
src/stun.c
src/sys.c
src/tcp.c
src/telev.c
src/test.c
src/thread.c
src/tmr.c
src/trace.c
src/trice.c
src/turn.c
src/udp.c
src/unixsock.c
src/uri.c
src/vid.c
src/vidconv.c
src/websock.c
)
if(USE_OPENSSL)
list(APPEND SRCS
src/tls.c
src/dtls.c
src/combo/dtls_turn.c
src/mock/cert.c
)
endif()
##############################################################################
#
# Main target object
#
set(LINKLIBS ${RE_LIBRARIES} ${OPENSSL_LIBRARIES})
if(WIN32)
list(APPEND LINKLIBS qwave iphlpapi wsock32 ws2_32)
else()
list(APPEND LINKLIBS -lpthread -lm ${RESOLV_LIBRARY})
endif()
if(ZLIB_FOUND)
list(APPEND LINKLIBS ZLIB::ZLIB)
endif()
add_executable(${PROJECT_NAME} ${SRCS})
set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS 1)
target_link_libraries(${PROJECT_NAME} PRIVATE ${LINKLIBS})
target_compile_definitions(${PROJECT_NAME} PRIVATE ${RE_DEFINITIONS})
if(USE_OPENSSL)
target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR})
endif()