blob: be36988273a28210265c452588c1216a88b3d040 [file] [log] [blame]
kjellanderc76dc952016-06-03 03:09:32 -07001# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("../build/webrtc.gni")
10
11group("pc") {
kjellander705ecc52016-09-15 00:53:26 -070012 public_deps = [
kjellanderc76dc952016-06-03 03:09:32 -070013 ":rtc_pc",
14 ]
15}
16
17config("rtc_pc_config") {
18 defines = [
19 "SRTP_RELATIVE_PATH",
20 "HAVE_SCTP",
21 "HAVE_SRTP",
22 ]
23}
24
kjellanderb62dbbe2016-09-23 00:38:52 -070025rtc_static_library("rtc_pc") {
kjellanderc76dc952016-06-03 03:09:32 -070026 defines = []
27 sources = [
28 "audiomonitor.cc",
29 "audiomonitor.h",
30 "bundlefilter.cc",
31 "bundlefilter.h",
32 "channel.cc",
33 "channel.h",
34 "channelmanager.cc",
35 "channelmanager.h",
36 "currentspeakermonitor.cc",
37 "currentspeakermonitor.h",
38 "mediamonitor.cc",
39 "mediamonitor.h",
40 "mediasession.cc",
41 "mediasession.h",
kjellanderc76dc952016-06-03 03:09:32 -070042 "rtcpmuxfilter.cc",
43 "rtcpmuxfilter.h",
44 "srtpfilter.cc",
45 "srtpfilter.h",
46 "voicechannel.h",
47 ]
48
49 deps = [
kjellandera69d9732016-08-31 07:33:05 -070050 "../api:call_api",
kjellanderc76dc952016-06-03 03:09:32 -070051 "../base:rtc_base",
52 "../media",
53 ]
54
55 if (build_with_chromium) {
56 sources += [
57 "externalhmac.cc",
58 "externalhmac.h",
59 ]
60 }
61 if (rtc_build_libsrtp) {
62 deps += [ "//third_party/libsrtp" ]
63 }
64
ehmaldonadoe9cc6862016-09-05 06:10:18 -070065 public_configs = [ ":rtc_pc_config" ]
kjellanderc76dc952016-06-03 03:09:32 -070066
67 if (is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070068 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070069 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -070070 }
71}
kjellander142f8c52016-06-13 00:08:24 -070072
73if (rtc_include_tests) {
74 config("rtc_pc_unittests_config") {
75 # GN orders flags on a target before flags from configs. The default config
76 # adds -Wall, and this flag have to be after -Wall -- so they need to
77 # come from a config and can't be on the target directly.
78 if (!is_win && !is_clang) {
79 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
80 }
81 }
82
ehmaldonado38a21322016-09-02 04:10:34 -070083 rtc_test("rtc_pc_unittests") {
kjellander142f8c52016-06-13 00:08:24 -070084 testonly = true
85
86 sources = [
87 "bundlefilter_unittest.cc",
88 "channel_unittest.cc",
89 "channelmanager_unittest.cc",
90 "currentspeakermonitor_unittest.cc",
91 "mediasession_unittest.cc",
92 "rtcpmuxfilter_unittest.cc",
93 "srtpfilter_unittest.cc",
94 ]
95
96 include_dirs = [ "//third_party/libsrtp/srtp" ]
97
ehmaldonado7a2ce0b2016-09-05 01:35:44 -070098 configs += [ ":rtc_pc_unittests_config" ]
kjellander142f8c52016-06-13 00:08:24 -070099
100 if (is_clang) {
101 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700102 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander142f8c52016-06-13 00:08:24 -0700103 }
104
105 if (is_win) {
106 libs = [ "strmiids.lib" ]
107 }
108
109 deps = [
110 ":rtc_pc",
111 "../api:libjingle_peerconnection",
112 "../base:rtc_base_tests_utils",
113 "../media:rtc_unittest_main",
114 "../system_wrappers:metrics_default",
115 ]
116
117 if (rtc_build_libsrtp) {
118 deps += [ "//third_party/libsrtp" ]
119 }
120
121 if (is_android) {
122 deps += [ "//testing/android/native_test:native_test_support" ]
123 }
124 }
125}