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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../webrtc.gni") |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 10 | if (is_android) { |
| 11 | import("//build/config/android/config.gni") |
| 12 | import("//build/config/android/rules.gni") |
| 13 | } |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 14 | |
| 15 | group("pc") { |
kjellander | 705ecc5 | 2016-09-15 00:53:26 -0700 | [diff] [blame] | 16 | public_deps = [ |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 17 | ":rtc_pc", |
| 18 | ] |
| 19 | } |
| 20 | |
| 21 | config("rtc_pc_config") { |
jbauch | eaa9c1d | 2017-03-06 11:32:22 -0800 | [diff] [blame] | 22 | defines = [] |
deadbeef | 40610e2 | 2016-12-22 10:53:38 -0800 | [diff] [blame] | 23 | if (rtc_enable_sctp) { |
| 24 | defines += [ "HAVE_SCTP" ] |
| 25 | } |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 26 | } |
| 27 | |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 28 | rtc_static_library("rtc_pc_base") { |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 29 | defines = [] |
| 30 | sources = [ |
| 31 | "audiomonitor.cc", |
| 32 | "audiomonitor.h", |
| 33 | "bundlefilter.cc", |
| 34 | "bundlefilter.h", |
| 35 | "channel.cc", |
| 36 | "channel.h", |
| 37 | "channelmanager.cc", |
| 38 | "channelmanager.h", |
| 39 | "currentspeakermonitor.cc", |
| 40 | "currentspeakermonitor.h", |
jbauch | dfcab72 | 2017-03-06 00:14:10 -0800 | [diff] [blame] | 41 | "externalhmac.cc", |
| 42 | "externalhmac.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 43 | "mediamonitor.cc", |
| 44 | "mediamonitor.h", |
| 45 | "mediasession.cc", |
| 46 | "mediasession.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 47 | "rtcpmuxfilter.cc", |
| 48 | "rtcpmuxfilter.h", |
zstein | d48dbda | 2017-04-04 19:45:57 -0700 | [diff] [blame] | 49 | "rtptransport.cc", |
| 50 | "rtptransport.h", |
zstein | 398c3fd | 2017-07-19 13:38:02 -0700 | [diff] [blame] | 51 | "rtptransportinternal.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 52 | "srtpfilter.cc", |
| 53 | "srtpfilter.h", |
zstein | 4dde3df | 2017-07-07 14:26:25 -0700 | [diff] [blame] | 54 | "srtpsession.cc", |
| 55 | "srtpsession.h", |
zstein | 398c3fd | 2017-07-19 13:38:02 -0700 | [diff] [blame] | 56 | "srtptransport.cc", |
| 57 | "srtptransport.h", |
Zhi Huang | b526158 | 2017-09-29 10:51:43 -0700 | [diff] [blame] | 58 | "transportcontroller.cc", |
| 59 | "transportcontroller.h", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 60 | "voicechannel.h", |
| 61 | ] |
| 62 | |
| 63 | deps = [ |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 64 | "..:webrtc_common", |
kjellander | a69d973 | 2016-08-31 07:33:05 -0700 | [diff] [blame] | 65 | "../api:call_api", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 66 | "../api:libjingle_peerconnection_api", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 67 | "../api:optional", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 68 | "../api:ortc_api", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 69 | "../media:rtc_data", |
zhihuang | 130ca7e | 2017-06-21 01:02:59 -0700 | [diff] [blame] | 70 | "../media:rtc_h264_profile_id", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 71 | "../media:rtc_media_base", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 72 | "../p2p:rtc_p2p", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 73 | "../rtc_base:rtc_base", |
| 74 | "../rtc_base:rtc_task_queue", |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 75 | ] |
| 76 | |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 77 | if (rtc_build_libsrtp) { |
| 78 | deps += [ "//third_party/libsrtp" ] |
| 79 | } |
| 80 | |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 81 | public_configs = [ ":rtc_pc_config" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 82 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 83 | if (!build_with_chromium && is_clang) { |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 84 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 85 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | c76dc95 | 2016-06-03 03:09:32 -0700 | [diff] [blame] | 86 | } |
| 87 | } |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 88 | |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 89 | rtc_source_set("rtc_pc") { |
| 90 | public_deps = [ |
| 91 | ":rtc_pc_base", |
| 92 | ] |
| 93 | |
| 94 | deps = [ |
| 95 | "../media:rtc_audio_video", |
| 96 | ] |
| 97 | } |
| 98 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 99 | config("libjingle_peerconnection_warnings_config") { |
| 100 | # GN orders flags on a target before flags from configs. The default config |
| 101 | # adds these flags so to cancel them out they need to come from a config and |
| 102 | # cannot be on the target directly. |
| 103 | if (!is_win && !is_clang) { |
| 104 | cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. |
| 105 | } |
| 106 | } |
| 107 | |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 108 | rtc_static_library("peerconnection") { |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 109 | cflags = [] |
| 110 | sources = [ |
| 111 | "audiotrack.cc", |
| 112 | "audiotrack.h", |
| 113 | "datachannel.cc", |
| 114 | "datachannel.h", |
| 115 | "dtmfsender.cc", |
| 116 | "dtmfsender.h", |
deadbeef | 1dcb164 | 2017-03-29 21:08:16 -0700 | [diff] [blame] | 117 | "iceserverparsing.cc", |
| 118 | "iceserverparsing.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 119 | "jsepicecandidate.cc", |
| 120 | "jsepsessiondescription.cc", |
| 121 | "localaudiosource.cc", |
| 122 | "localaudiosource.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 123 | "mediastream.cc", |
| 124 | "mediastream.h", |
| 125 | "mediastreamobserver.cc", |
| 126 | "mediastreamobserver.h", |
| 127 | "mediastreamtrack.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 128 | "peerconnection.cc", |
| 129 | "peerconnection.h", |
| 130 | "peerconnectionfactory.cc", |
| 131 | "peerconnectionfactory.h", |
| 132 | "remoteaudiosource.cc", |
| 133 | "remoteaudiosource.h", |
| 134 | "rtcstatscollector.cc", |
| 135 | "rtcstatscollector.h", |
| 136 | "rtpreceiver.cc", |
| 137 | "rtpreceiver.h", |
| 138 | "rtpsender.cc", |
| 139 | "rtpsender.h", |
| 140 | "sctputils.cc", |
| 141 | "sctputils.h", |
Steve Anton | 97a9f76 | 2017-10-06 10:14:03 -0700 | [diff] [blame] | 142 | "sdputils.cc", |
| 143 | "sdputils.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 144 | "statscollector.cc", |
| 145 | "statscollector.h", |
| 146 | "streamcollection.h", |
deadbeef | 804c1af | 2017-02-11 19:07:31 -0800 | [diff] [blame] | 147 | "trackmediainfomap.cc", |
| 148 | "trackmediainfomap.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 149 | "videocapturertracksource.cc", |
| 150 | "videocapturertracksource.h", |
| 151 | "videotrack.cc", |
| 152 | "videotrack.h", |
| 153 | "videotracksource.cc", |
| 154 | "videotracksource.h", |
| 155 | "webrtcsdp.cc", |
| 156 | "webrtcsdp.h", |
| 157 | "webrtcsession.cc", |
| 158 | "webrtcsession.h", |
| 159 | "webrtcsessiondescriptionfactory.cc", |
| 160 | "webrtcsessiondescriptionfactory.h", |
| 161 | ] |
| 162 | |
| 163 | configs += [ ":libjingle_peerconnection_warnings_config" ] |
| 164 | |
| 165 | if (!build_with_chromium && is_clang) { |
| 166 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 167 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 168 | } |
| 169 | |
| 170 | deps = [ |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 171 | ":rtc_pc_base", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 172 | "..:webrtc_common", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 173 | "../api:call_api", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 174 | "../api:optional", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 175 | "../api:rtc_stats_api", |
ilnik | d60d06a | 2017-04-05 03:02:20 -0700 | [diff] [blame] | 176 | "../api/video_codecs:video_codecs_api", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 177 | "../call:call_interfaces", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 178 | "../logging:rtc_event_log_api", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 179 | "../media:rtc_data", |
| 180 | "../media:rtc_media_base", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 181 | "../p2p:rtc_p2p", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 182 | "../rtc_base:rtc_base", |
| 183 | "../rtc_base:rtc_base_approved", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 184 | "../stats", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 185 | "../system_wrappers:system_wrappers", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 186 | ] |
| 187 | |
ossu | da25006 | 2017-01-23 07:37:43 -0800 | [diff] [blame] | 188 | public_deps = [ |
| 189 | "../api:libjingle_peerconnection_api", |
| 190 | ] |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | # This target implements CreatePeerConnectionFactory methods that will create a |
| 194 | # PeerConnection will full functionality (audio, video and data). Applications |
| 195 | # that wish to reduce their binary size by ommitting functionality they don't |
| 196 | # need should use CreateModularCreatePeerConnectionFactory instead, using the |
| 197 | # "peerconnection" build target and other targets specific to their |
| 198 | # requrements. See comment in peerconnectionfactoryinterface.h. |
zhihuang | ab97e18 | 2017-06-22 01:28:59 -0700 | [diff] [blame] | 199 | rtc_static_library("create_pc_factory") { |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 200 | sources = [ |
| 201 | "createpeerconnectionfactory.cc", |
| 202 | ] |
| 203 | |
| 204 | deps = [ |
| 205 | "../api:audio_mixer_api", |
| 206 | "../api:libjingle_peerconnection_api", |
| 207 | "../api/audio_codecs:audio_codecs_api", |
| 208 | "../api/audio_codecs:builtin_audio_decoder_factory", |
| 209 | "../api/audio_codecs:builtin_audio_encoder_factory", |
Magnus Jedvert | 58b0316 | 2017-09-15 19:02:47 +0200 | [diff] [blame] | 210 | "../api/video_codecs:video_codecs_api", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 211 | "../call", |
| 212 | "../call:call_interfaces", |
| 213 | "../logging:rtc_event_log_api", |
| 214 | "../media:rtc_audio_video", |
| 215 | "../modules/audio_device:audio_device", |
peah | a9cc40b | 2017-06-29 08:32:09 -0700 | [diff] [blame] | 216 | "../modules/audio_processing:audio_processing", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 217 | "../rtc_base:rtc_base", |
| 218 | "../rtc_base:rtc_base_approved", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 219 | ] |
| 220 | |
| 221 | configs += [ ":libjingle_peerconnection_warnings_config" ] |
| 222 | |
| 223 | if (!build_with_chromium && is_clang) { |
| 224 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 225 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | rtc_source_set("libjingle_peerconnection") { |
| 230 | public_deps = [ |
| 231 | ":create_pc_factory", |
| 232 | ":peerconnection", |
| 233 | "../api:libjingle_peerconnection_api", |
| 234 | ] |
ossu | da25006 | 2017-01-23 07:37:43 -0800 | [diff] [blame] | 235 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 236 | if (rtc_use_quic) { |
| 237 | sources += [ |
| 238 | "quicdatachannel.cc", |
| 239 | "quicdatachannel.h", |
| 240 | "quicdatatransport.cc", |
| 241 | "quicdatatransport.h", |
| 242 | ] |
| 243 | deps += [ "//third_party/libquic" ] |
| 244 | public_deps = [ |
| 245 | "//third_party/libquic", |
| 246 | ] |
| 247 | } |
| 248 | } |
| 249 | |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 250 | if (rtc_include_tests) { |
| 251 | config("rtc_pc_unittests_config") { |
| 252 | # GN orders flags on a target before flags from configs. The default config |
| 253 | # adds -Wall, and this flag have to be after -Wall -- so they need to |
| 254 | # come from a config and can't be on the target directly. |
| 255 | if (!is_win && !is_clang) { |
| 256 | cflags = [ "-Wno-maybe-uninitialized" ] # Only exists for GCC. |
| 257 | } |
| 258 | } |
| 259 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 260 | rtc_test("rtc_pc_unittests") { |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 261 | testonly = true |
| 262 | |
| 263 | sources = [ |
| 264 | "bundlefilter_unittest.cc", |
| 265 | "channel_unittest.cc", |
| 266 | "channelmanager_unittest.cc", |
| 267 | "currentspeakermonitor_unittest.cc", |
| 268 | "mediasession_unittest.cc", |
| 269 | "rtcpmuxfilter_unittest.cc", |
zstein | 56162b9 | 2017-04-24 16:54:35 -0700 | [diff] [blame] | 270 | "rtptransport_unittest.cc", |
zstein | 398c3fd | 2017-07-19 13:38:02 -0700 | [diff] [blame] | 271 | "rtptransporttestutil.h", |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 272 | "srtpfilter_unittest.cc", |
zstein | 4dde3df | 2017-07-07 14:26:25 -0700 | [diff] [blame] | 273 | "srtpsession_unittest.cc", |
| 274 | "srtptestutil.h", |
zstein | 398c3fd | 2017-07-19 13:38:02 -0700 | [diff] [blame] | 275 | "srtptransport_unittest.cc", |
Zhi Huang | b526158 | 2017-09-29 10:51:43 -0700 | [diff] [blame] | 276 | "transportcontroller_unittest.cc", |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 277 | ] |
| 278 | |
| 279 | include_dirs = [ "//third_party/libsrtp/srtp" ] |
| 280 | |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 281 | configs += [ ":rtc_pc_unittests_config" ] |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 282 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 283 | if (!build_with_chromium && is_clang) { |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 284 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 285 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | if (is_win) { |
| 289 | libs = [ "strmiids.lib" ] |
| 290 | } |
| 291 | |
| 292 | deps = [ |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 293 | ":libjingle_peerconnection", |
Zhi Huang | b526158 | 2017-09-29 10:51:43 -0700 | [diff] [blame] | 294 | ":pc_test_utils", |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 295 | ":rtc_pc", |
kwiberg | 529662a | 2017-09-04 05:43:17 -0700 | [diff] [blame] | 296 | "../api:array_view", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 297 | "../logging:rtc_event_log_api", |
| 298 | "../media:rtc_media_base", |
mbonadei | 9087d49 | 2017-04-25 00:35:35 -0700 | [diff] [blame] | 299 | "../media:rtc_media_tests_utils", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 300 | "../p2p:p2p_test_utils", |
| 301 | "../p2p:rtc_p2p", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 302 | "../rtc_base:rtc_base", |
| 303 | "../rtc_base:rtc_base_approved", |
| 304 | "../rtc_base:rtc_base_tests_main", |
| 305 | "../rtc_base:rtc_base_tests_utils", |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 306 | "../system_wrappers:metrics_default", |
zstein | 398c3fd | 2017-07-19 13:38:02 -0700 | [diff] [blame] | 307 | "../test:test_support", |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 308 | ] |
| 309 | |
| 310 | if (rtc_build_libsrtp) { |
| 311 | deps += [ "//third_party/libsrtp" ] |
| 312 | } |
| 313 | |
| 314 | if (is_android) { |
| 315 | deps += [ "//testing/android/native_test:native_test_support" ] |
| 316 | } |
| 317 | } |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 318 | |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 319 | rtc_source_set("pc_test_utils") { |
| 320 | testonly = true |
| 321 | sources = [ |
| 322 | "test/fakeaudiocapturemodule.cc", |
| 323 | "test/fakeaudiocapturemodule.h", |
| 324 | "test/fakedatachannelprovider.h", |
| 325 | "test/fakeperiodicvideocapturer.h", |
| 326 | "test/fakertccertificategenerator.h", |
Zhi Huang | b526158 | 2017-09-29 10:51:43 -0700 | [diff] [blame] | 327 | "test/faketransportcontroller.h", |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 328 | "test/fakevideotrackrenderer.h", |
| 329 | "test/fakevideotracksource.h", |
| 330 | "test/mock_datachannel.h", |
| 331 | "test/mock_peerconnection.h", |
| 332 | "test/mock_webrtcsession.h", |
| 333 | "test/mockpeerconnectionobservers.h", |
| 334 | "test/peerconnectiontestwrapper.cc", |
| 335 | "test/peerconnectiontestwrapper.h", |
| 336 | "test/rtcstatsobtainer.h", |
| 337 | "test/testsdpstrings.h", |
| 338 | ] |
| 339 | |
| 340 | deps = [ |
| 341 | ":libjingle_peerconnection", |
Zhi Huang | b526158 | 2017-09-29 10:51:43 -0700 | [diff] [blame] | 342 | ":rtc_pc_base", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 343 | "..:webrtc_common", |
| 344 | "../api:libjingle_peerconnection_test_api", |
| 345 | "../api:rtc_stats_api", |
zhihuang | 38ede13 | 2017-06-15 12:52:32 -0700 | [diff] [blame] | 346 | "../call:call_interfaces", |
| 347 | "../logging:rtc_event_log_api", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 348 | "../media:rtc_media", |
| 349 | "../media:rtc_media_tests_utils", |
| 350 | "../modules/audio_device:audio_device", |
| 351 | "../p2p:p2p_test_utils", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 352 | "../rtc_base:rtc_base", |
| 353 | "../rtc_base:rtc_base_approved", |
| 354 | "../rtc_base:rtc_base_tests_utils", |
mbonadei | 7d9a55b | 2017-06-01 13:01:48 -0700 | [diff] [blame] | 355 | "../test:test_support", |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 356 | "//testing/gmock", |
| 357 | ] |
| 358 | |
| 359 | if (!build_with_chromium && is_clang) { |
| 360 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 361 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 362 | } |
| 363 | } |
| 364 | |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 365 | config("peerconnection_unittests_config") { |
| 366 | # The warnings below are enabled by default. Since GN orders compiler flags |
| 367 | # for a target before flags from configs, the only way to disable such |
| 368 | # warnings is by having them in a separate config, loaded from the target. |
| 369 | # TODO(kjellander): Make the code compile without disabling these flags. |
| 370 | # See https://bugs.webrtc.org/3307. |
| 371 | if (is_clang && is_win) { |
| 372 | cflags = [ |
| 373 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6267 |
| 374 | # for -Wno-sign-compare |
| 375 | "-Wno-sign-compare", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 376 | ] |
| 377 | } |
| 378 | |
| 379 | if (!is_win) { |
| 380 | cflags = [ "-Wno-sign-compare" ] |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | rtc_test("peerconnection_unittests") { |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 385 | testonly = true |
| 386 | sources = [ |
| 387 | "datachannel_unittest.cc", |
| 388 | "dtmfsender_unittest.cc", |
deadbeef | 1dcb164 | 2017-03-29 21:08:16 -0700 | [diff] [blame] | 389 | "iceserverparsing_unittest.cc", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 390 | "jsepsessiondescription_unittest.cc", |
| 391 | "localaudiosource_unittest.cc", |
| 392 | "mediaconstraintsinterface_unittest.cc", |
| 393 | "mediastream_unittest.cc", |
Steve Anton | 6b63cd5 | 2017-10-06 11:20:31 -0700 | [diff] [blame^] | 394 | "peerconnection_crypto_unittest.cc", |
deadbeef | 1dcb164 | 2017-03-29 21:08:16 -0700 | [diff] [blame] | 395 | "peerconnection_integrationtest.cc", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 396 | "peerconnectionendtoend_unittest.cc", |
| 397 | "peerconnectionfactory_unittest.cc", |
| 398 | "peerconnectioninterface_unittest.cc", |
Steve Anton | 94286cb | 2017-09-26 16:20:19 -0700 | [diff] [blame] | 399 | "peerconnectionwrapper.cc", |
| 400 | "peerconnectionwrapper.h", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 401 | "proxy_unittest.cc", |
| 402 | "rtcstats_integrationtest.cc", |
| 403 | "rtcstatscollector_unittest.cc", |
| 404 | "rtpsenderreceiver_unittest.cc", |
| 405 | "sctputils_unittest.cc", |
| 406 | "statscollector_unittest.cc", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 407 | "test/fakeaudiocapturemodule_unittest.cc", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 408 | "test/testsdpstrings.h", |
deadbeef | 804c1af | 2017-02-11 19:07:31 -0800 | [diff] [blame] | 409 | "trackmediainfomap_unittest.cc", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 410 | "videocapturertracksource_unittest.cc", |
| 411 | "videotrack_unittest.cc", |
| 412 | "webrtcsdp_unittest.cc", |
| 413 | "webrtcsession_unittest.cc", |
| 414 | ] |
| 415 | |
| 416 | if (rtc_enable_sctp) { |
| 417 | defines = [ "HAVE_SCTP" ] |
| 418 | } |
| 419 | |
| 420 | configs += [ ":peerconnection_unittests_config" ] |
| 421 | |
| 422 | if (!build_with_chromium && is_clang) { |
| 423 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 424 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 425 | } |
| 426 | |
| 427 | # TODO(jschuh): Bug 1348: fix this warning. |
| 428 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 429 | |
| 430 | if (is_win) { |
| 431 | cflags = [ |
| 432 | "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. |
| 433 | "/wd4389", # signed/unsigned mismatch. |
| 434 | ] |
| 435 | } |
| 436 | |
| 437 | if (rtc_use_quic) { |
| 438 | public_deps = [ |
| 439 | "//third_party/libquic", |
| 440 | ] |
| 441 | sources += [ |
| 442 | "quicdatachannel_unittest.cc", |
| 443 | "quicdatatransport_unittest.cc", |
| 444 | ] |
| 445 | } |
| 446 | |
| 447 | deps = [] |
| 448 | if (is_android) { |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 449 | deps += [ ":android_black_magic" ] |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | deps += [ |
| 453 | ":libjingle_peerconnection", |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 454 | ":pc_test_utils", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 455 | "..:webrtc_common", |
| 456 | "../api:fakemetricsobserver", |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 457 | "../api:libjingle_peerconnection_test_api", |
| 458 | "../api:rtc_stats_api", |
| 459 | "../api/audio_codecs:builtin_audio_decoder_factory", |
| 460 | "../api/audio_codecs:builtin_audio_encoder_factory", |
| 461 | "../media:rtc_audio_video", |
| 462 | "../media:rtc_data", # TODO(phoglund): AFAIK only used for one sctp constant. |
| 463 | "../media:rtc_media_base", |
mbonadei | 9087d49 | 2017-04-25 00:35:35 -0700 | [diff] [blame] | 464 | "../media:rtc_media_tests_utils", |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 465 | "../modules/audio_processing:audio_processing", |
| 466 | "../modules/utility:utility", |
| 467 | "../p2p:p2p_test_utils", |
| 468 | "../p2p:rtc_p2p", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 469 | "../pc:rtc_pc", |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 470 | "../rtc_base:rtc_base_approved", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 471 | "../rtc_base:rtc_base_tests_main", |
| 472 | "../rtc_base:rtc_base_tests_utils", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 473 | "../system_wrappers:metrics_default", |
kwiberg | 2b3aa14 | 2017-06-14 03:31:17 -0700 | [diff] [blame] | 474 | "../test:audio_codec_mocks", |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 475 | "../test:test_support", |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 476 | ] |
| 477 | |
| 478 | if (is_android) { |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 479 | deps += [ |
| 480 | "//testing/android/native_test:native_test_support", |
| 481 | |
| 482 | # We need to depend on this one directly, or classloads will fail for |
| 483 | # the voice engine BuildInfo, for instance. |
| 484 | "../sdk/android:libjingle_peerconnection_java", |
| 485 | ] |
ossu | 7bb87ee | 2017-01-23 04:56:25 -0800 | [diff] [blame] | 486 | |
| 487 | shard_timeout = 900 |
| 488 | } |
| 489 | } |
Patrik Höglund | 563934e | 2017-09-15 09:04:28 +0200 | [diff] [blame] | 490 | |
| 491 | if (is_android) { |
| 492 | rtc_source_set("android_black_magic") { |
| 493 | # The android code uses hacky includes to chromium-base and the ssl code; |
| 494 | # having this in a separate target enables us to keep the peerconnection |
| 495 | # unit tests clean. |
| 496 | check_includes = false |
| 497 | testonly = true |
| 498 | sources = [ |
| 499 | "test/androidtestinitializer.cc", |
| 500 | "test/androidtestinitializer.h", |
| 501 | ] |
| 502 | deps = [ |
| 503 | "../sdk/android:libjingle_peerconnection_jni", |
| 504 | "//testing/android/native_test:native_test_support", |
| 505 | ] |
| 506 | } |
| 507 | } |
kjellander | 142f8c5 | 2016-06-13 00:08:24 -0700 | [diff] [blame] | 508 | } |