blob: 906d99575b05c9bc1983e4f6dd96fcd7aade0be2 [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")
kjellander142f8c52016-06-13 00:08:24 -070010import("//testing/test.gni")
kjellanderc76dc952016-06-03 03:09:32 -070011
12group("pc") {
13 deps = [
14 ":rtc_pc",
15 ]
16}
17
18config("rtc_pc_config") {
19 defines = [
20 "SRTP_RELATIVE_PATH",
21 "HAVE_SCTP",
22 "HAVE_SRTP",
23 ]
24}
25
26source_set("rtc_pc") {
27 defines = []
28 sources = [
29 "audiomonitor.cc",
30 "audiomonitor.h",
31 "bundlefilter.cc",
32 "bundlefilter.h",
33 "channel.cc",
34 "channel.h",
35 "channelmanager.cc",
36 "channelmanager.h",
37 "currentspeakermonitor.cc",
38 "currentspeakermonitor.h",
39 "mediamonitor.cc",
40 "mediamonitor.h",
41 "mediasession.cc",
42 "mediasession.h",
43 "mediasink.h",
44 "rtcpmuxfilter.cc",
45 "rtcpmuxfilter.h",
46 "srtpfilter.cc",
47 "srtpfilter.h",
48 "voicechannel.h",
49 ]
50
51 deps = [
kjellandera69d9732016-08-31 07:33:05 -070052 "../api:call_api",
kjellanderc76dc952016-06-03 03:09:32 -070053 "../base:rtc_base",
54 "../media",
55 ]
56
57 if (build_with_chromium) {
58 sources += [
59 "externalhmac.cc",
60 "externalhmac.h",
61 ]
62 }
63 if (rtc_build_libsrtp) {
64 deps += [ "//third_party/libsrtp" ]
65 }
66
67 configs += [ "..:common_config" ]
68 public_configs = [
69 "..:common_inherited_config",
70 ":rtc_pc_config",
71 ]
72
73 if (is_clang) {
kjellander142f8c52016-06-13 00:08:24 -070074 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
kjellanderc76dc952016-06-03 03:09:32 -070075 configs -= [ "//build/config/clang:find_bad_constructs" ]
76 }
77}
kjellander142f8c52016-06-13 00:08:24 -070078
79if (rtc_include_tests) {
80 config("rtc_pc_unittests_config") {
81 # GN orders flags on a target before flags from configs. The default config
82 # adds -Wall, and this flag have to be after -Wall -- so they need to
83 # come from a config and can't be on the target directly.
84 if (!is_win && !is_clang) {
85 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
86 }
87 }
88
89 test("rtc_pc_unittests") {
90 testonly = true
91
92 sources = [
93 "bundlefilter_unittest.cc",
94 "channel_unittest.cc",
95 "channelmanager_unittest.cc",
96 "currentspeakermonitor_unittest.cc",
97 "mediasession_unittest.cc",
98 "rtcpmuxfilter_unittest.cc",
99 "srtpfilter_unittest.cc",
100 ]
101
102 include_dirs = [ "//third_party/libsrtp/srtp" ]
103
104 configs += [
105 "..:common_config",
106 ":rtc_pc_unittests_config",
107 ]
108 public_configs = [ "..:common_inherited_config" ]
109
110 if (is_clang) {
111 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
112 configs -= [ "//build/config/clang:find_bad_constructs" ]
113 }
114
115 if (is_win) {
116 libs = [ "strmiids.lib" ]
117 }
118
119 deps = [
120 ":rtc_pc",
121 "../api:libjingle_peerconnection",
122 "../base:rtc_base_tests_utils",
123 "../media:rtc_unittest_main",
124 "../system_wrappers:metrics_default",
125 ]
126
127 if (rtc_build_libsrtp) {
128 deps += [ "//third_party/libsrtp" ]
129 }
130
131 if (is_android) {
132 deps += [ "//testing/android/native_test:native_test_support" ]
133 }
134 }
135}