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