blob: fe8711fa26485c4cb422d24b5d7d3b129c00347f [file] [log] [blame]
kjellander3944b5a2016-06-03 10:09:321# 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") {
kjellander4c5e7eb2016-09-15 07:53:2612 public_deps = [
kjellander3944b5a2016-06-03 10:09:3213 ":rtc_pc",
14 ]
15}
16
17config("rtc_pc_config") {
18 defines = [
kjellander3944b5a2016-06-03 10:09:3219 "HAVE_SCTP",
20 "HAVE_SRTP",
21 ]
22}
23
kjellander2cf29b52016-09-23 07:38:5224rtc_static_library("rtc_pc") {
kjellander3944b5a2016-06-03 10:09:3225 defines = []
26 sources = [
27 "audiomonitor.cc",
28 "audiomonitor.h",
29 "bundlefilter.cc",
30 "bundlefilter.h",
31 "channel.cc",
32 "channel.h",
33 "channelmanager.cc",
34 "channelmanager.h",
35 "currentspeakermonitor.cc",
36 "currentspeakermonitor.h",
37 "mediamonitor.cc",
38 "mediamonitor.h",
39 "mediasession.cc",
40 "mediasession.h",
kjellander3944b5a2016-06-03 10:09:3241 "rtcpmuxfilter.cc",
42 "rtcpmuxfilter.h",
43 "srtpfilter.cc",
44 "srtpfilter.h",
45 "voicechannel.h",
46 ]
47
48 deps = [
kjellandercf820622016-08-31 14:33:0549 "../api:call_api",
kjellander3944b5a2016-06-03 10:09:3250 "../base:rtc_base",
51 "../media",
52 ]
53
54 if (build_with_chromium) {
55 sources += [
56 "externalhmac.cc",
57 "externalhmac.h",
58 ]
59 }
60 if (rtc_build_libsrtp) {
61 deps += [ "//third_party/libsrtp" ]
62 }
63
ehmaldonado80e66922016-09-05 13:10:1864 public_configs = [ ":rtc_pc_config" ]
kjellander3944b5a2016-06-03 10:09:3265
kjellandera6c66232016-10-17 06:56:1266 if (!build_with_chromium && is_clang) {
kjellandera996c6a2016-06-13 07:08:2467 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonadof0532f32016-09-02 11:10:3468 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander3944b5a2016-06-03 10:09:3269 }
70}
kjellandera996c6a2016-06-13 07:08:2471
72if (rtc_include_tests) {
73 config("rtc_pc_unittests_config") {
74 # GN orders flags on a target before flags from configs. The default config
75 # adds -Wall, and this flag have to be after -Wall -- so they need to
76 # come from a config and can't be on the target directly.
77 if (!is_win && !is_clang) {
78 cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC.
79 }
80 }
81
ehmaldonadof0532f32016-09-02 11:10:3482 rtc_test("rtc_pc_unittests") {
kjellandera996c6a2016-06-13 07:08:2483 testonly = true
84
85 sources = [
86 "bundlefilter_unittest.cc",
87 "channel_unittest.cc",
88 "channelmanager_unittest.cc",
89 "currentspeakermonitor_unittest.cc",
90 "mediasession_unittest.cc",
91 "rtcpmuxfilter_unittest.cc",
92 "srtpfilter_unittest.cc",
93 ]
94
95 include_dirs = [ "//third_party/libsrtp/srtp" ]
96
ehmaldonado1d492192016-09-05 08:35:4497 configs += [ ":rtc_pc_unittests_config" ]
kjellandera996c6a2016-06-13 07:08:2498
kjellandera6c66232016-10-17 06:56:1299 if (!build_with_chromium && is_clang) {
kjellandera996c6a2016-06-13 07:08:24100 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonadof0532f32016-09-02 11:10:34101 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellandera996c6a2016-06-13 07:08:24102 }
103
104 if (is_win) {
105 libs = [ "strmiids.lib" ]
106 }
107
108 deps = [
109 ":rtc_pc",
110 "../api:libjingle_peerconnection",
111 "../base:rtc_base_tests_utils",
112 "../media:rtc_unittest_main",
113 "../system_wrappers:metrics_default",
114 ]
115
116 if (rtc_build_libsrtp) {
117 deps += [ "//third_party/libsrtp" ]
118 }
119
120 if (is_android) {
121 deps += [ "//testing/android/native_test:native_test_support" ]
122 }
123 }
124}