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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/secondary/third_party/libsrtp/BUILD.gn
diff --git a/build/secondary/third_party/libsrtp/BUILD.gn b/build/secondary/third_party/libsrtp/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..dbcf8ea613107cdd651e3b94f33a5e55d7623919
--- /dev/null
+++ b/build/secondary/third_party/libsrtp/BUILD.gn
@@ -0,0 +1,312 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+declare_args() {
+ use_system_libsrtp = false
+}
+
+config("libsrtp_config") {
+ defines = [
+ "HAVE_STDLIB_H",
+ "HAVE_STRING_H",
+ ]
+
+ include_dirs = [
+ "./config",
brettw 2014/06/30 23:54:53 You don't need "./"
rvargas (doing something else) 2014/07/01 00:34:27 Done.
+ "srtp/include",
+ "srtp/crypto/include",
+ ]
+
+ if (is_posix) {
+ defines += [
+ "HAVE_INT16_T",
+ "HAVE_INT32_T",
+ "HAVE_INT8_T",
+ "HAVE_UINT16_T",
+ "HAVE_UINT32_T",
+ "HAVE_UINT64_T",
+ "HAVE_UINT8_T",
+ "HAVE_STDINT_H",
+ "HAVE_INTTYPES_H",
+ "HAVE_NETINET_IN_H",
+ "INLINE=inline",
+ ]
+ }
+
+ if (is_win) {
+ defines += [
+ "INLINE=__inline",
+ "HAVE_BYTESWAP_METHODS_H",
+ # All Windows architectures are this way.
+ "SIZEOF_UNSIGNED_LONG=4",
+ "SIZEOF_UNSIGNED_LONG_LONG=8",
+ ]
+ }
+
+ if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") {
+ defines += [
+ # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm
+ # platform for unknown reasons, need to investigate the root cause
+ # of it. CPU_RISC is used for optimization only, and CPU_CISC should
+ # just work just fine, it has been tested on android/arm with srtp
+ # test applications and libjingle.
+ "CPU_CISC",
+ ]
+ }
+
+ if (cpu_arch == "mipsel") {
+ defines += [ "CPU_RISC" ]
+ }
+}
+
+config("system_libsrtp_config") {
+ defines = [ "USE_SYSTEM_LIBSRTP" ]
+ include_dirs = [ "/usr/include/srtp" ]
+}
+
+if (use_system_libsrtp) {
+ group("libsrtp") {
+ direct_dependent_configs = [ ":libsrtp_config", ":system_libsrtp_config" ]
+ libs += [ "-lsrtp" ]
brettw 2014/06/30 23:54:53 += should be =
rvargas (doing something else) 2014/07/01 00:34:27 Done.
+ }
+} else {
+ static_library("libsrtp") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+
+ sources = [
+ # includes
+ "srtp/include/ekt.h",
+ "srtp/include/getopt_s.h",
+ "srtp/include/rtp.h",
+ "srtp/include/rtp_priv.h",
+ "srtp/include/srtp.h",
+ "srtp/include/srtp_priv.h",
+ "srtp/include/ut_sim.h",
+
+ # headers
+ "srtp/crypto/include/aes_cbc.h",
+ "srtp/crypto/include/aes.h",
+ "srtp/crypto/include/aes_icm.h",
+ "srtp/crypto/include/alloc.h",
+ "srtp/crypto/include/auth.h",
+ "srtp/crypto/include/cipher.h",
+ "srtp/crypto/include/cryptoalg.h",
+ "srtp/crypto/include/crypto.h",
+ "srtp/crypto/include/crypto_kernel.h",
+ "srtp/crypto/include/crypto_math.h",
+ "srtp/crypto/include/crypto_types.h",
+ "srtp/crypto/include/datatypes.h",
+ "srtp/crypto/include/err.h",
+ "srtp/crypto/include/gf2_8.h",
+ "srtp/crypto/include/hmac.h",
+ "srtp/crypto/include/integers.h",
+ "srtp/crypto/include/kernel_compat.h",
+ "srtp/crypto/include/key.h",
+ "srtp/crypto/include/null_auth.h",
+ "srtp/crypto/include/null_cipher.h",
+ "srtp/crypto/include/prng.h",
+ "srtp/crypto/include/rand_source.h",
+ "srtp/crypto/include/rdb.h",
+ "srtp/crypto/include/rdbx.h",
+ "srtp/crypto/include/sha1.h",
+ "srtp/crypto/include/stat.h",
+ "srtp/crypto/include/xfm.h",
+
+ # sources
+ "srtp/srtp/ekt.c",
+ "srtp/srtp/srtp.c",
+
+ "srtp/crypto/cipher/aes.c",
+ "srtp/crypto/cipher/aes_cbc.c",
+ "srtp/crypto/cipher/aes_icm.c",
+ "srtp/crypto/cipher/cipher.c",
+ "srtp/crypto/cipher/null_cipher.c",
+ "srtp/crypto/hash/auth.c",
+ "srtp/crypto/hash/hmac.c",
+ "srtp/crypto/hash/null_auth.c",
+ "srtp/crypto/hash/sha1.c",
+ "srtp/crypto/kernel/alloc.c",
+ "srtp/crypto/kernel/crypto_kernel.c",
+ "srtp/crypto/kernel/err.c",
+ "srtp/crypto/kernel/key.c",
+ "srtp/crypto/math/datatypes.c",
+ "srtp/crypto/math/gf2_8.c",
+ "srtp/crypto/math/stat.c",
+ "srtp/crypto/replay/rdb.c",
+ "srtp/crypto/replay/rdbx.c",
+ "srtp/crypto/replay/ut_sim.c",
+ "srtp/crypto/rng/ctr_prng.c",
+ "srtp/crypto/rng/prng.c",
+ "srtp/crypto/rng/rand_source.c",
+ ]
+ }
+
+ executable("rdbx_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/include/getopt_s.h",
+ "srtp/test/getopt_s.c",
+ "srtp/test/rdbx_driver.c",
+ ]
+ }
+
+ executable("srtp_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/include/getopt_s.h",
+ "srtp/include/srtp_priv.h",
+ "srtp/test/getopt_s.c",
+ "srtp/test/srtp_driver.c",
+ ]
+ }
+
+ executable("roc_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/include/rdbx.h",
+ "srtp/include/ut_sim.h",
+ "srtp/test/roc_driver.c",
+ ]
+ }
+
+ executable("replay_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/include/rdbx.h",
+ "srtp/include/ut_sim.h",
+ "srtp/test/replay_driver.c",
+ ]
+ }
+
+ executable("rtpw") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/include/getopt_s.h",
+ "srtp/include/rtp.h",
+ "srtp/include/srtp.h",
+ "srtp/crypto/include/datatypes.h",
+ "srtp/test/getopt_s.c",
+ "srtp/test/rtp.c",
+ "srtp/test/rtpw.c",
+ ]
+ if (is_android) {
+ defines = [ "HAVE_SYS_SOCKET_H" ]
+ }
+ }
+
+ executable("srtp_test_cipher_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/cipher_driver.c",
+ ]
+ }
+
+ executable("srtp_test_datatypes_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/datatypes_driver.c",
+ ]
+ }
+
+ executable("srtp_test_stat_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/stat_driver.c",
+ ]
+ }
+
+ executable("srtp_test_sha1_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/sha1_driver.c",
+ ]
+ }
+
+ executable("srtp_test_kernel_driver") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/kernel_driver.c",
+ ]
+ }
+
+ executable("srtp_test_aes_calc") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/aes_calc.c",
+ ]
+ }
+
+ executable("srtp_test_rand_gen") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/rand_gen.c",
+ ]
+ }
+
+ executable("srtp_test_env") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libsrtp_config" ]
+ deps = [ ":libsrtp" ]
+ sources = [
+ "srtp/crypto/test/env.c",
+ ]
+ }
+
+ group("srtp_runtest") {
+ deps = [
+ ":rdbx_driver",
+ ":srtp_driver",
+ ":roc_driver",
+ ":replay_driver",
+ ":rtpw",
+ ":srtp_test_cipher_driver",
+ ":srtp_test_datatypes_driver",
+ ":srtp_test_stat_driver",
+ ":srtp_test_sha1_driver",
+ ":srtp_test_kernel_driver",
+ ":srtp_test_aes_calc",
+ ":srtp_test_rand_gen",
+ ":srtp_test_env",
+ ]
+ }
+}
« 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