Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: build/secondary/third_party/libsrtp/BUILD.gn

Issue 363473003: Add gn support for libsrtp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 declare_args() {
6 use_system_libsrtp = false
7 }
8
9 config("libsrtp_config") {
10 defines = [
11 "HAVE_STDLIB_H",
12 "HAVE_STRING_H",
13 ]
14
15 include_dirs = [
16 "./config",
brettw 2014/06/30 23:54:53 You don't need "./"
rvargas (doing something else) 2014/07/01 00:34:27 Done.
17 "srtp/include",
18 "srtp/crypto/include",
19 ]
20
21 if (is_posix) {
22 defines += [
23 "HAVE_INT16_T",
24 "HAVE_INT32_T",
25 "HAVE_INT8_T",
26 "HAVE_UINT16_T",
27 "HAVE_UINT32_T",
28 "HAVE_UINT64_T",
29 "HAVE_UINT8_T",
30 "HAVE_STDINT_H",
31 "HAVE_INTTYPES_H",
32 "HAVE_NETINET_IN_H",
33 "INLINE=inline",
34 ]
35 }
36
37 if (is_win) {
38 defines += [
39 "INLINE=__inline",
40 "HAVE_BYTESWAP_METHODS_H",
41 # All Windows architectures are this way.
42 "SIZEOF_UNSIGNED_LONG=4",
43 "SIZEOF_UNSIGNED_LONG_LONG=8",
44 ]
45 }
46
47 if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") {
48 defines += [
49 # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm
50 # platform for unknown reasons, need to investigate the root cause
51 # of it. CPU_RISC is used for optimization only, and CPU_CISC should
52 # just work just fine, it has been tested on android/arm with srtp
53 # test applications and libjingle.
54 "CPU_CISC",
55 ]
56 }
57
58 if (cpu_arch == "mipsel") {
59 defines += [ "CPU_RISC" ]
60 }
61 }
62
63 config("system_libsrtp_config") {
64 defines = [ "USE_SYSTEM_LIBSRTP" ]
65 include_dirs = [ "/usr/include/srtp" ]
66 }
67
68 if (use_system_libsrtp) {
69 group("libsrtp") {
70 direct_dependent_configs = [ ":libsrtp_config", ":system_libsrtp_config" ]
71 libs += [ "-lsrtp" ]
brettw 2014/06/30 23:54:53 += should be =
rvargas (doing something else) 2014/07/01 00:34:27 Done.
72 }
73 } else {
74 static_library("libsrtp") {
75 configs -= [ "//build/config/compiler:chromium_code" ]
76 configs += [ "//build/config/compiler:no_chromium_code" ]
77 configs += [ ":libsrtp_config" ]
78
79 sources = [
80 # includes
81 "srtp/include/ekt.h",
82 "srtp/include/getopt_s.h",
83 "srtp/include/rtp.h",
84 "srtp/include/rtp_priv.h",
85 "srtp/include/srtp.h",
86 "srtp/include/srtp_priv.h",
87 "srtp/include/ut_sim.h",
88
89 # headers
90 "srtp/crypto/include/aes_cbc.h",
91 "srtp/crypto/include/aes.h",
92 "srtp/crypto/include/aes_icm.h",
93 "srtp/crypto/include/alloc.h",
94 "srtp/crypto/include/auth.h",
95 "srtp/crypto/include/cipher.h",
96 "srtp/crypto/include/cryptoalg.h",
97 "srtp/crypto/include/crypto.h",
98 "srtp/crypto/include/crypto_kernel.h",
99 "srtp/crypto/include/crypto_math.h",
100 "srtp/crypto/include/crypto_types.h",
101 "srtp/crypto/include/datatypes.h",
102 "srtp/crypto/include/err.h",
103 "srtp/crypto/include/gf2_8.h",
104 "srtp/crypto/include/hmac.h",
105 "srtp/crypto/include/integers.h",
106 "srtp/crypto/include/kernel_compat.h",
107 "srtp/crypto/include/key.h",
108 "srtp/crypto/include/null_auth.h",
109 "srtp/crypto/include/null_cipher.h",
110 "srtp/crypto/include/prng.h",
111 "srtp/crypto/include/rand_source.h",
112 "srtp/crypto/include/rdb.h",
113 "srtp/crypto/include/rdbx.h",
114 "srtp/crypto/include/sha1.h",
115 "srtp/crypto/include/stat.h",
116 "srtp/crypto/include/xfm.h",
117
118 # sources
119 "srtp/srtp/ekt.c",
120 "srtp/srtp/srtp.c",
121
122 "srtp/crypto/cipher/aes.c",
123 "srtp/crypto/cipher/aes_cbc.c",
124 "srtp/crypto/cipher/aes_icm.c",
125 "srtp/crypto/cipher/cipher.c",
126 "srtp/crypto/cipher/null_cipher.c",
127 "srtp/crypto/hash/auth.c",
128 "srtp/crypto/hash/hmac.c",
129 "srtp/crypto/hash/null_auth.c",
130 "srtp/crypto/hash/sha1.c",
131 "srtp/crypto/kernel/alloc.c",
132 "srtp/crypto/kernel/crypto_kernel.c",
133 "srtp/crypto/kernel/err.c",
134 "srtp/crypto/kernel/key.c",
135 "srtp/crypto/math/datatypes.c",
136 "srtp/crypto/math/gf2_8.c",
137 "srtp/crypto/math/stat.c",
138 "srtp/crypto/replay/rdb.c",
139 "srtp/crypto/replay/rdbx.c",
140 "srtp/crypto/replay/ut_sim.c",
141 "srtp/crypto/rng/ctr_prng.c",
142 "srtp/crypto/rng/prng.c",
143 "srtp/crypto/rng/rand_source.c",
144 ]
145 }
146
147 executable("rdbx_driver") {
148 configs -= [ "//build/config/compiler:chromium_code" ]
149 configs += [ "//build/config/compiler:no_chromium_code" ]
150 configs += [ ":libsrtp_config" ]
151 deps = [ ":libsrtp" ]
152 sources = [
153 "srtp/include/getopt_s.h",
154 "srtp/test/getopt_s.c",
155 "srtp/test/rdbx_driver.c",
156 ]
157 }
158
159 executable("srtp_driver") {
160 configs -= [ "//build/config/compiler:chromium_code" ]
161 configs += [ "//build/config/compiler:no_chromium_code" ]
162 configs += [ ":libsrtp_config" ]
163 deps = [ ":libsrtp" ]
164 sources = [
165 "srtp/include/getopt_s.h",
166 "srtp/include/srtp_priv.h",
167 "srtp/test/getopt_s.c",
168 "srtp/test/srtp_driver.c",
169 ]
170 }
171
172 executable("roc_driver") {
173 configs -= [ "//build/config/compiler:chromium_code" ]
174 configs += [ "//build/config/compiler:no_chromium_code" ]
175 configs += [ ":libsrtp_config" ]
176 deps = [ ":libsrtp" ]
177 sources = [
178 "srtp/crypto/include/rdbx.h",
179 "srtp/include/ut_sim.h",
180 "srtp/test/roc_driver.c",
181 ]
182 }
183
184 executable("replay_driver") {
185 configs -= [ "//build/config/compiler:chromium_code" ]
186 configs += [ "//build/config/compiler:no_chromium_code" ]
187 configs += [ ":libsrtp_config" ]
188 deps = [ ":libsrtp" ]
189 sources = [
190 "srtp/crypto/include/rdbx.h",
191 "srtp/include/ut_sim.h",
192 "srtp/test/replay_driver.c",
193 ]
194 }
195
196 executable("rtpw") {
197 configs -= [ "//build/config/compiler:chromium_code" ]
198 configs += [ "//build/config/compiler:no_chromium_code" ]
199 configs += [ ":libsrtp_config" ]
200 deps = [ ":libsrtp" ]
201 sources = [
202 "srtp/include/getopt_s.h",
203 "srtp/include/rtp.h",
204 "srtp/include/srtp.h",
205 "srtp/crypto/include/datatypes.h",
206 "srtp/test/getopt_s.c",
207 "srtp/test/rtp.c",
208 "srtp/test/rtpw.c",
209 ]
210 if (is_android) {
211 defines = [ "HAVE_SYS_SOCKET_H" ]
212 }
213 }
214
215 executable("srtp_test_cipher_driver") {
216 configs -= [ "//build/config/compiler:chromium_code" ]
217 configs += [ "//build/config/compiler:no_chromium_code" ]
218 configs += [ ":libsrtp_config" ]
219 deps = [ ":libsrtp" ]
220 sources = [
221 "srtp/crypto/test/cipher_driver.c",
222 ]
223 }
224
225 executable("srtp_test_datatypes_driver") {
226 configs -= [ "//build/config/compiler:chromium_code" ]
227 configs += [ "//build/config/compiler:no_chromium_code" ]
228 configs += [ ":libsrtp_config" ]
229 deps = [ ":libsrtp" ]
230 sources = [
231 "srtp/crypto/test/datatypes_driver.c",
232 ]
233 }
234
235 executable("srtp_test_stat_driver") {
236 configs -= [ "//build/config/compiler:chromium_code" ]
237 configs += [ "//build/config/compiler:no_chromium_code" ]
238 configs += [ ":libsrtp_config" ]
239 deps = [ ":libsrtp" ]
240 sources = [
241 "srtp/crypto/test/stat_driver.c",
242 ]
243 }
244
245 executable("srtp_test_sha1_driver") {
246 configs -= [ "//build/config/compiler:chromium_code" ]
247 configs += [ "//build/config/compiler:no_chromium_code" ]
248 configs += [ ":libsrtp_config" ]
249 deps = [ ":libsrtp" ]
250 sources = [
251 "srtp/crypto/test/sha1_driver.c",
252 ]
253 }
254
255 executable("srtp_test_kernel_driver") {
256 configs -= [ "//build/config/compiler:chromium_code" ]
257 configs += [ "//build/config/compiler:no_chromium_code" ]
258 configs += [ ":libsrtp_config" ]
259 deps = [ ":libsrtp" ]
260 sources = [
261 "srtp/crypto/test/kernel_driver.c",
262 ]
263 }
264
265 executable("srtp_test_aes_calc") {
266 configs -= [ "//build/config/compiler:chromium_code" ]
267 configs += [ "//build/config/compiler:no_chromium_code" ]
268 configs += [ ":libsrtp_config" ]
269 deps = [ ":libsrtp" ]
270 sources = [
271 "srtp/crypto/test/aes_calc.c",
272 ]
273 }
274
275 executable("srtp_test_rand_gen") {
276 configs -= [ "//build/config/compiler:chromium_code" ]
277 configs += [ "//build/config/compiler:no_chromium_code" ]
278 configs += [ ":libsrtp_config" ]
279 deps = [ ":libsrtp" ]
280 sources = [
281 "srtp/crypto/test/rand_gen.c",
282 ]
283 }
284
285 executable("srtp_test_env") {
286 configs -= [ "//build/config/compiler:chromium_code" ]
287 configs += [ "//build/config/compiler:no_chromium_code" ]
288 configs += [ ":libsrtp_config" ]
289 deps = [ ":libsrtp" ]
290 sources = [
291 "srtp/crypto/test/env.c",
292 ]
293 }
294
295 group("srtp_runtest") {
296 deps = [
297 ":rdbx_driver",
298 ":srtp_driver",
299 ":roc_driver",
300 ":replay_driver",
301 ":rtpw",
302 ":srtp_test_cipher_driver",
303 ":srtp_test_datatypes_driver",
304 ":srtp_test_stat_driver",
305 ":srtp_test_sha1_driver",
306 ":srtp_test_kernel_driver",
307 ":srtp_test_aes_calc",
308 ":srtp_test_rand_gen",
309 ":srtp_test_env",
310 ]
311 }
312 }
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698