kjellander | 3944b5a | 2016-06-03 10:09:32 | [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 | 4c5e7eb | 2016-09-15 07:53:26 | [diff] [blame] | 12 | public_deps = [ |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 13 | ":rtc_pc", |
| 14 | ] |
| 15 | } |
| 16 | |
| 17 | config("rtc_pc_config") { |
| 18 | defines = [ |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 19 | "HAVE_SCTP", |
| 20 | "HAVE_SRTP", |
| 21 | ] |
| 22 | } |
| 23 | |
kjellander | 2cf29b5 | 2016-09-23 07:38:52 | [diff] [blame] | 24 | rtc_static_library("rtc_pc") { |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 25 | 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", |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 41 | "rtcpmuxfilter.cc", |
| 42 | "rtcpmuxfilter.h", |
| 43 | "srtpfilter.cc", |
| 44 | "srtpfilter.h", |
| 45 | "voicechannel.h", |
| 46 | ] |
| 47 | |
| 48 | deps = [ |
kjellander | cf82062 | 2016-08-31 14:33:05 | [diff] [blame] | 49 | "../api:call_api", |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 50 | "../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 | |
ehmaldonado | 80e6692 | 2016-09-05 13:10:18 | [diff] [blame] | 64 | public_configs = [ ":rtc_pc_config" ] |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 65 | |
kjellander | a6c6623 | 2016-10-17 06:56:12 | [diff] [blame] | 66 | if (!build_with_chromium && is_clang) { |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 67 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | f0532f3 | 2016-09-02 11:10:34 | [diff] [blame] | 68 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 3944b5a | 2016-06-03 10:09:32 | [diff] [blame] | 69 | } |
| 70 | } |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 71 | |
| 72 | if (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 | |
ehmaldonado | f0532f3 | 2016-09-02 11:10:34 | [diff] [blame] | 82 | rtc_test("rtc_pc_unittests") { |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 83 | 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 | |
ehmaldonado | 1d49219 | 2016-09-05 08:35:44 | [diff] [blame] | 97 | configs += [ ":rtc_pc_unittests_config" ] |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 98 | |
kjellander | a6c6623 | 2016-10-17 06:56:12 | [diff] [blame] | 99 | if (!build_with_chromium && is_clang) { |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 100 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | f0532f3 | 2016-09-02 11:10:34 | [diff] [blame] | 101 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | a996c6a | 2016-06-13 07:08:24 | [diff] [blame] | 102 | } |
| 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 | } |