| OLD | NEW |
| 1 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found |
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
| 8 | 8 |
| 9 import("../build/webrtc.gni") | 9 import("../build/webrtc.gni") |
| 10 import("//testing/test.gni") |
| 10 | 11 |
| 11 group("api") { | 12 group("api") { |
| 12 deps = [ | 13 deps = [ |
| 13 ":libjingle_peerconnection", | 14 ":libjingle_peerconnection", |
| 14 ] | 15 ] |
| 15 } | 16 } |
| 16 | 17 |
| 17 config("libjingle_peerconnection_warnings_config") { | 18 config("libjingle_peerconnection_warnings_config") { |
| 18 # GN orders flags on a target before flags from configs. The default config | 19 # GN orders flags on a target before flags from configs. The default config |
| 19 # adds these flags so to cancel them out they need to come from a config and | 20 # adds these flags so to cancel them out they need to come from a config and |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 "webrtcsessiondescriptionfactory.h", | 99 "webrtcsessiondescriptionfactory.h", |
| 99 ] | 100 ] |
| 100 | 101 |
| 101 configs += [ | 102 configs += [ |
| 102 "..:common_config", | 103 "..:common_config", |
| 103 ":libjingle_peerconnection_warnings_config", | 104 ":libjingle_peerconnection_warnings_config", |
| 104 ] | 105 ] |
| 105 public_configs = [ "..:common_inherited_config" ] | 106 public_configs = [ "..:common_inherited_config" ] |
| 106 | 107 |
| 107 if (is_clang) { | 108 if (is_clang) { |
| 108 # Suppress warnings from Chrome's Clang plugins. | 109 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 109 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. | |
| 110 configs -= [ "//build/config/clang:extra_warnings" ] | |
| 111 configs -= [ "//build/config/clang:find_bad_constructs" ] | 110 configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 112 } | 111 } |
| 113 | 112 |
| 114 if (is_win) { | 113 if (is_win) { |
| 115 cflags += [ "/wd4389" ] # signed/unsigned mismatch. | 114 cflags += [ "/wd4389" ] # signed/unsigned mismatch. |
| 116 } | 115 } |
| 117 | 116 |
| 118 deps = [ | 117 deps = [ |
| 119 "../call", | 118 "../call", |
| 120 "../media", | 119 "../media", |
| 121 "../pc", | 120 "../pc", |
| 122 ] | 121 ] |
| 123 | 122 |
| 124 if (rtc_use_quic) { | 123 if (rtc_use_quic) { |
| 125 sources += [ | 124 sources += [ |
| 126 "quicdatachannel.cc", | 125 "quicdatachannel.cc", |
| 127 "quicdatachannel.h", | 126 "quicdatachannel.h", |
| 128 "quicdatatransport.cc", | 127 "quicdatatransport.cc", |
| 129 "quicdatatransport.h", | 128 "quicdatatransport.h", |
| 130 ] | 129 ] |
| 131 deps += [ "//third_party/libquic" ] | 130 deps += [ "//third_party/libquic" ] |
| 132 public_deps = [ | 131 public_deps = [ |
| 133 "//third_party/libquic", | 132 "//third_party/libquic", |
| 134 ] | 133 ] |
| 135 } | 134 } |
| 136 } | 135 } |
| 136 |
| 137 if (is_android) { |
| 138 config("libjingle_peerconnection_jni_warnings_config") { |
| 139 # The warnings below are enabled by default. Since GN orders compiler flags |
| 140 # for a target before flags from configs, the only way to disable such |
| 141 # warnings is by having them in a separate config, loaded from the target. |
| 142 if (!is_win) { |
| 143 cflags = [ |
| 144 "-Wno-sign-compare", |
| 145 "-Wno-unused-variable", |
| 146 ] |
| 147 } |
| 148 } |
| 149 |
| 150 source_set("libjingle_peerconnection_jni") { |
| 151 sources = [ |
| 152 "androidvideocapturer.cc", |
| 153 "androidvideocapturer.h", |
| 154 "java/jni/androidmediacodeccommon.h", |
| 155 "java/jni/androidmediadecoder_jni.cc", |
| 156 "java/jni/androidmediadecoder_jni.h", |
| 157 "java/jni/androidmediaencoder_jni.cc", |
| 158 "java/jni/androidmediaencoder_jni.h", |
| 159 "java/jni/androidmetrics_jni.cc", |
| 160 "java/jni/androidnetworkmonitor_jni.cc", |
| 161 "java/jni/androidnetworkmonitor_jni.h", |
| 162 "java/jni/androidvideocapturer_jni.cc", |
| 163 "java/jni/androidvideocapturer_jni.h", |
| 164 "java/jni/classreferenceholder.cc", |
| 165 "java/jni/classreferenceholder.h", |
| 166 "java/jni/jni_helpers.cc", |
| 167 "java/jni/jni_helpers.h", |
| 168 "java/jni/native_handle_impl.cc", |
| 169 "java/jni/native_handle_impl.h", |
| 170 "java/jni/peerconnection_jni.cc", |
| 171 "java/jni/surfacetexturehelper_jni.cc", |
| 172 "java/jni/surfacetexturehelper_jni.h", |
| 173 ] |
| 174 |
| 175 configs += [ |
| 176 "..:common_config", |
| 177 ":libjingle_peerconnection_jni_warnings_config", |
| 178 ] |
| 179 public_configs = [ "..:common_inherited_config" ] |
| 180 |
| 181 if (is_clang) { |
| 182 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 183 configs -= [ |
| 184 "//build/config/clang:extra_warnings", |
| 185 "//build/config/clang:find_bad_constructs", |
| 186 ] |
| 187 } |
| 188 |
| 189 # TODO(jschuh): Bug 1348: fix this warning. |
| 190 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 191 |
| 192 if (is_win) { |
| 193 cflags += [ |
| 194 "/wd4245", # conversion from "int" to "size_t", signed/unsigned mismatc
h. |
| 195 "/wd4389", # signed/unsigned mismatch. |
| 196 ] |
| 197 } |
| 198 |
| 199 deps = [ |
| 200 ":libjingle_peerconnection", |
| 201 "../system_wrappers:field_trial_default", |
| 202 "../system_wrappers:metrics_default", |
| 203 ] |
| 204 |
| 205 if (rtc_build_libyuv) { |
| 206 deps += [ "$rtc_libyuv_dir" ] |
| 207 public_deps = [ |
| 208 "$rtc_libyuv_dir", |
| 209 ] |
| 210 } else { |
| 211 # Need to add a directory normally exported by libyuv. |
| 212 include_dirs += [ "$rtc_libyuv_dir/include" ] |
| 213 } |
| 214 } |
| 215 } |
| 216 |
| 217 if (rtc_include_tests) { |
| 218 config("peerconnection_unittests_config") { |
| 219 # The warnings below are enabled by default. Since GN orders compiler flags |
| 220 # for a target before flags from configs, the only way to disable such |
| 221 # warnings is by having them in a separate config, loaded from the target. |
| 222 # TODO(kjellander): Make the code compile without disabling these flags. |
| 223 # See https://bugs.webrtc.org/3307. |
| 224 if (is_clang && is_win) { |
| 225 cflags = [ "-Wno-unused-function" ] |
| 226 } |
| 227 |
| 228 if (!is_win) { |
| 229 cflags = [ "-Wno-sign-compare" ] |
| 230 cflags_cc = [ "-Wno-overloaded-virtual" ] |
| 231 } |
| 232 } |
| 233 |
| 234 test("peerconnection_unittests") { |
| 235 testonly = true |
| 236 sources = [ |
| 237 "datachannel_unittest.cc", |
| 238 "dtmfsender_unittest.cc", |
| 239 "fakemetricsobserver.cc", |
| 240 "fakemetricsobserver.h", |
| 241 "jsepsessiondescription_unittest.cc", |
| 242 "localaudiosource_unittest.cc", |
| 243 "mediaconstraintsinterface_unittest.cc", |
| 244 "mediastream_unittest.cc", |
| 245 "peerconnection_unittest.cc", |
| 246 "peerconnectionendtoend_unittest.cc", |
| 247 "peerconnectionfactory_unittest.cc", |
| 248 "peerconnectioninterface_unittest.cc", |
| 249 "proxy_unittest.cc", |
| 250 "rtpsenderreceiver_unittest.cc", |
| 251 "statscollector_unittest.cc", |
| 252 "test/fakeaudiocapturemodule.cc", |
| 253 "test/fakeaudiocapturemodule.h", |
| 254 "test/fakeaudiocapturemodule_unittest.cc", |
| 255 "test/fakeconstraints.h", |
| 256 "test/fakedatachannelprovider.h", |
| 257 "test/fakeperiodicvideocapturer.h", |
| 258 "test/fakertccertificategenerator.h", |
| 259 "test/fakevideotrackrenderer.h", |
| 260 "test/mockpeerconnectionobservers.h", |
| 261 "test/peerconnectiontestwrapper.cc", |
| 262 "test/peerconnectiontestwrapper.h", |
| 263 "test/testsdpstrings.h", |
| 264 "videocapturertracksource_unittest.cc", |
| 265 "videotrack_unittest.cc", |
| 266 "webrtcsdp_unittest.cc", |
| 267 "webrtcsession_unittest.cc", |
| 268 ] |
| 269 |
| 270 defines = [ "HAVE_SCTP" ] |
| 271 |
| 272 configs += [ |
| 273 "..:common_config", |
| 274 ":peerconnection_unittests_config", |
| 275 ] |
| 276 public_configs = [ "..:common_inherited_config" ] |
| 277 |
| 278 if (is_clang) { |
| 279 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 280 configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 281 } |
| 282 |
| 283 # TODO(jschuh): Bug 1348: fix this warning. |
| 284 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 285 |
| 286 if (is_win) { |
| 287 cflags = [ |
| 288 "/wd4245", # conversion from int to size_t, signed/unsigned mismatch. |
| 289 "/wd4389", # signed/unsigned mismatch. |
| 290 ] |
| 291 } |
| 292 |
| 293 if (rtc_use_quic) { |
| 294 public_deps = [ |
| 295 "//third_party/libquic", |
| 296 ] |
| 297 sources += [ |
| 298 "quicdatachannel_unittest.cc", |
| 299 "quicdatatransport_unittest.cc", |
| 300 ] |
| 301 } |
| 302 |
| 303 deps = [] |
| 304 if (is_android) { |
| 305 sources += [ |
| 306 "test/androidtestinitializer.cc", |
| 307 "test/androidtestinitializer.h", |
| 308 ] |
| 309 deps += [ |
| 310 ":libjingle_peerconnection_jni", |
| 311 "//testing/android/native_test:native_test_support", |
| 312 ] |
| 313 } |
| 314 |
| 315 deps += [ |
| 316 ":libjingle_peerconnection", |
| 317 "..:webrtc_common", |
| 318 "../base:rtc_base_tests_utils", |
| 319 "../media:rtc_unittest_main", |
| 320 "../pc:rtc_pc", |
| 321 "../system_wrappers:metrics_default", |
| 322 "//testing/gmock", |
| 323 ] |
| 324 |
| 325 if (is_android) { |
| 326 deps += [ "//testing/android/native_test:native_test_support" ] |
| 327 } |
| 328 } |
| 329 } |
| OLD | NEW |