blob: 821257782a593b0e49c887331c23cb54b6a60d66 [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") {
12 deps = [
13 ":rtc_pc",
14 ]
15}
16
17config("rtc_pc_config") {
18 defines = [
19 "SRTP_RELATIVE_PATH",
20 "HAVE_SCTP",
21 "HAVE_SRTP",
22 ]
23}
24
ehmaldonado38a21322016-09-02 04:10:34 -070025rtc_source_set("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",
42 "mediasink.h",
43 "rtcpmuxfilter.cc",
44 "rtcpmuxfilter.h",
45 "srtpfilter.cc",
46 "srtpfilter.h",
47 "voicechannel.h",
48 ]
49
50 deps = [
kjellandera69d9732016-08-31 07:33:05 -070051 "../api:call_api",
kjellanderc76dc952016-06-03 03:09:32 -070052 "../base:rtc_base",
53 "../media",
54 ]
55
56 if (build_with_chromium) {
57 sources += [
58 "externalhmac.cc",
59 "externalhmac.h",
60 ]
61 }
62 if (rtc_build_libsrtp) {
63 deps += [ "//third_party/libsrtp" ]
64 }
65
kjellanderc76dc952016-06-03 03:09:32 -070066 public_configs = [
67 "..:common_inherited_config",
68 ":rtc_pc_config",
69 ]
70
71 if (is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070072 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070073 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellanderc76dc952016-06-03 03:09:32 -070074 }
75}
kjellander142f8c52016-06-13 00:08:24 -070076
77if (rtc_include_tests) {
78 config("rtc_pc_unittests_config") {
79 # GN orders flags on a target before flags from configs. The default config
80 # adds -Wall, and this flag have to be after -Wall -- so they need to
81 # come from a config and can't be on the target directly.
82 if (!is_win && !is_clang) {
83 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
84 }
85 }
86
ehmaldonado38a21322016-09-02 04:10:34 -070087 rtc_test("rtc_pc_unittests") {
kjellander142f8c52016-06-13 00:08:24 -070088 testonly = true
89
90 sources = [
91 "bundlefilter_unittest.cc",
92 "channel_unittest.cc",
93 "channelmanager_unittest.cc",
94 "currentspeakermonitor_unittest.cc",
95 "mediasession_unittest.cc",
96 "rtcpmuxfilter_unittest.cc",
97 "srtpfilter_unittest.cc",
98 ]
99
100 include_dirs = [ "//third_party/libsrtp/srtp" ]
101
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700102 configs += [ ":rtc_pc_unittests_config" ]
kjellander142f8c52016-06-13 00:08:24 -0700103 public_configs = [ "..:common_inherited_config" ]
104
105 if (is_clang) {
106 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700107 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander142f8c52016-06-13 00:08:24 -0700108 }
109
110 if (is_win) {
111 libs = [ "strmiids.lib" ]
112 }
113
114 deps = [
115 ":rtc_pc",
116 "../api:libjingle_peerconnection",
117 "../base:rtc_base_tests_utils",
118 "../media:rtc_unittest_main",
119 "../system_wrappers:metrics_default",
120 ]
121
122 if (rtc_build_libsrtp) {
123 deps += [ "//third_party/libsrtp" ]
124 }
125
126 if (is_android) {
127 deps += [ "//testing/android/native_test:native_test_support" ]
128 }
129 }
130}