kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 1 | # 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 | |
| 9 | import("../build/webrtc.gni") |
| 10 | |
| 11 | group("pc") { |
kjellander | 705ecc5 | 2016-09-15 00:53:26 -0700 | [diff] [blame] | 12 | public_deps = [ |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 13 | ":rtc_pc", |
| 14 | ] |
| 15 | } |
| 16 | |
| 17 | config("rtc_pc_config") { |
| 18 | defines = [ |
| 19 | "SRTP_RELATIVE_PATH", |
| 20 | "HAVE_SCTP", |
| 21 | "HAVE_SRTP", |
| 22 | ] |
| 23 | } |
| 24 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame^] | 25 | rtc_static_library("rtc_pc") { |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 26 | 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 = [ |
kjellander | a69d973 | 2016-08-31 07:33:05 -0700 | [diff] [blame] | 51 | "../api:call_api", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 52 | "../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 | |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 66 | public_configs = [ ":rtc_pc_config" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 67 | |
| 68 | if (is_clang) { |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 69 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 70 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 71 | } |
| 72 | } |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 73 | |
| 74 | if (rtc_include_tests) { |
| 75 | config("rtc_pc_unittests_config") { |
| 76 | # GN orders flags on a target before flags from configs. The default config |
| 77 | # adds -Wall, and this flag have to be after -Wall -- so they need to |
| 78 | # come from a config and can't be on the target directly. |
| 79 | if (!is_win && !is_clang) { |
| 80 | cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. |
| 81 | } |
| 82 | } |
| 83 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 84 | rtc_test("rtc_pc_unittests") { |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 85 | testonly = true |
| 86 | |
| 87 | sources = [ |
| 88 | "bundlefilter_unittest.cc", |
| 89 | "channel_unittest.cc", |
| 90 | "channelmanager_unittest.cc", |
| 91 | "currentspeakermonitor_unittest.cc", |
| 92 | "mediasession_unittest.cc", |
| 93 | "rtcpmuxfilter_unittest.cc", |
| 94 | "srtpfilter_unittest.cc", |
| 95 | ] |
| 96 | |
| 97 | include_dirs = [ "//third_party/libsrtp/srtp" ] |
| 98 | |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 99 | configs += [ ":rtc_pc_unittests_config" ] |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 100 | |
| 101 | if (is_clang) { |
| 102 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 103 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | if (is_win) { |
| 107 | libs = [ "strmiids.lib" ] |
| 108 | } |
| 109 | |
| 110 | deps = [ |
| 111 | ":rtc_pc", |
| 112 | "../api:libjingle_peerconnection", |
| 113 | "../base:rtc_base_tests_utils", |
| 114 | "../media:rtc_unittest_main", |
| 115 | "../system_wrappers:metrics_default", |
| 116 | ] |
| 117 | |
| 118 | if (rtc_build_libsrtp) { |
| 119 | deps += [ "//third_party/libsrtp" ] |
| 120 | } |
| 121 | |
| 122 | if (is_android) { |
| 123 | deps += [ "//testing/android/native_test:native_test_support" ] |
| 124 | } |
| 125 | } |
| 126 | } |