blob: aba2a37df578fee5958c3434fdafd28ebe6026bb [file] [log] [blame]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +02001# 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
Qiang Chen43fb9122017-12-20 10:47:36 -080010
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020011if (is_android) {
12 import("//build/config/android/config.gni")
13 import("//build/config/android/rules.gni")
tkchin2ddfdba2016-08-07 21:37:45 -070014} else if (is_mac) {
15 import("//build/config/mac/rules.gni")
16} else if (is_ios) {
17 import("//build/config/ios/rules.gni")
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020018}
19
20group("examples") {
kjellander6ceab082016-10-28 05:44:03 -070021 # This target shall build all targets in examples.
22 testonly = true
Mirko Bonadei1a339c32017-12-14 13:06:10 +010023 deps = []
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020024
tkchin2ddfdba2016-08-07 21:37:45 -070025 if (is_android) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010026 deps += [
kjellander6ceab082016-10-28 05:44:03 -070027 ":AppRTCMobile",
28 ":AppRTCMobileTest",
mandermoa6069e82017-01-16 02:23:09 -080029 ":AppRTCMobileTestStubbedVideoIO",
George Zhou2770c3d2018-03-07 09:58:54 -080030 ":libwebrtc_unity",
kjellander6ceab082016-10-28 05:44:03 -070031 ]
Sami Kalliomäki3e77afd2018-03-08 16:43:16 +010032
33 # TODO(sakal): We include some code from the tests. Remove this dependency
34 # and remove this if-clause.
35 if (rtc_include_tests) {
36 deps += [ "androidnativeapi:androidnativeapi" ]
37 }
kjellander6ceab082016-10-28 05:44:03 -070038 }
39
charujainaca3a242016-11-01 03:09:15 -070040 if (!build_with_chromium) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010041 deps += [ ":stun_prober" ]
charujainaca3a242016-11-01 03:09:15 -070042 }
43
kjellander6ceab082016-10-28 05:44:03 -070044 if (is_ios || (is_mac && target_cpu != "x86")) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010045 deps += [ ":AppRTCMobile" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020046 }
kjellander6ceab082016-10-28 05:44:03 -070047
48 if (is_linux || is_win) {
Mirko Bonadei1a339c32017-12-14 13:06:10 +010049 deps += [
kthelgason0727f152016-08-08 09:03:23 -070050 ":peerconnection_client",
51 ":peerconnection_server",
52 ":relayserver",
53 ":stunserver",
54 ":turnserver",
55 ]
56 }
George Zhou2770c3d2018-03-07 09:58:54 -080057
58 if (is_android || is_win) {
59 deps += [ ":webrtc_unity_plugin" ]
60 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020061}
62
tkchin2ddfdba2016-08-07 21:37:45 -070063if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000064 rtc_android_apk("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -080065 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020066 apk_name = "AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020067 android_manifest = "androidapp/AndroidManifest.xml"
68
69 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +020070 ":AppRTCMobile_javalib",
71 ":AppRTCMobile_resources",
jianjun.zhuc0247402017-07-11 06:20:45 -070072 "../rtc_base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020073 "//base:base_java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020074 ]
75
jianjun.zhuc0247402017-07-11 06:20:45 -070076 shared_libraries = [ "../sdk/android:libjingle_peerconnection_so" ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020077 }
78
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +000079 rtc_android_library("AppRTCMobile_javalib") {
kjellander1993b1d2017-03-06 00:29:21 -080080 testonly = true
Mirko Bonadei4f024ef2018-01-04 13:12:03 +010081 android_manifest_for_lint = "androidapp/AndroidManifest.xml"
sakal07a050f2017-02-13 05:58:27 -080082
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020083 java_files = [
84 "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java",
henrikac3c2f312016-12-14 07:36:56 -080085 "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020086 "androidapp/src/org/appspot/apprtc/AppRTCClient.java",
87 "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java",
88 "androidapp/src/org/appspot/apprtc/CallActivity.java",
89 "androidapp/src/org/appspot/apprtc/CallFragment.java",
90 "androidapp/src/org/appspot/apprtc/CaptureQualityController.java",
91 "androidapp/src/org/appspot/apprtc/ConnectActivity.java",
92 "androidapp/src/org/appspot/apprtc/CpuMonitor.java",
93 "androidapp/src/org/appspot/apprtc/DirectRTCClient.java",
94 "androidapp/src/org/appspot/apprtc/HudFragment.java",
95 "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020096 "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java",
Qingsi Wanga4e72b72018-02-12 10:34:18 -080097 "androidapp/src/org/appspot/apprtc/RtcEventLog.java",
henrika5641fbb2018-02-21 14:12:53 +010098 "androidapp/src/org/appspot/apprtc/RecordedAudioToFileController.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +020099 "androidapp/src/org/appspot/apprtc/SettingsActivity.java",
100 "androidapp/src/org/appspot/apprtc/SettingsFragment.java",
101 "androidapp/src/org/appspot/apprtc/TCPChannelClient.java",
102 "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java",
103 "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java",
104 "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java",
105 "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java",
106 "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200107 ]
108
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100109 javac_args = [
110 "-Xep:ParameterNotNullable:ERROR",
111 "-Xep:FieldMissingNullable:ERROR",
112 "-Xep:ReturnMissingNullable:ERROR",
113 ]
114
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200115 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200116 ":AppRTCMobile_resources",
Paulina Hensman17071682018-03-26 16:10:29 +0200117 "../modules/audio_device:audio_device_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700118 "../rtc_base:base_java",
Magnus Jedverte2be7ee2018-04-04 10:42:25 +0200119 "../sdk/android:audio_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200120 "../sdk/android:base_java",
121 "../sdk/android:hwcodecs_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700122 "../sdk/android:libjingle_peerconnection_java",
123 "../sdk/android:libjingle_peerconnection_metrics_default_java",
Sami Kalliomäki725c1062018-03-28 10:49:18 +0200124 "../sdk/android:swcodecs_java",
jianjun.zhuc0247402017-07-11 06:20:45 -0700125 "androidapp/third_party/autobanh:autobanh_java",
Sami Kalliomäki06e363a2018-03-22 13:42:50 +0100126 "//third_party/jsr-305:jsr_305_javalib",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200127 ]
128 }
129
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200130 android_resources("AppRTCMobile_resources") {
kjellander1993b1d2017-03-06 00:29:21 -0800131 testonly = true
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200132 resource_dirs = [ "androidapp/res" ]
133 custom_package = "org.appspot.apprtc"
134 }
135
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000136 rtc_instrumentation_test_apk("AppRTCMobileTest") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200137 apk_name = "AppRTCMobileTest"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200138 android_manifest = "androidtests/AndroidManifest.xml"
139
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100140 java_files = [
141 "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java",
142 ]
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200143
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200144 apk_under_test = ":AppRTCMobile"
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200145
146 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200147 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700148 "../sdk/android:libjingle_peerconnection_java",
sakalcb79d512017-01-11 06:21:26 -0800149 "//third_party/android_support_test_runner:runner_java",
150 "//third_party/junit",
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200151 ]
152 }
mandermoa6069e82017-01-16 02:23:09 -0800153
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000154 rtc_instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") {
mandermoa6069e82017-01-16 02:23:09 -0800155 apk_name = "AppRTCMobileTestStubbedVideoIO"
156 android_manifest = "androidtests/AndroidManifest.xml"
157
oprypin30cda5e2017-04-24 04:15:13 -0700158 java_files = [ "androidtests/src/org/appspot/apprtc/test/CallActivityStubbedInputOutputTest.java" ]
mandermoa6069e82017-01-16 02:23:09 -0800159
160 apk_under_test = ":AppRTCMobile"
161
162 deps = [
163 ":AppRTCMobile_javalib",
jianjun.zhuc0247402017-07-11 06:20:45 -0700164 "../sdk/android:libjingle_peerconnection_java",
mandermoa6069e82017-01-16 02:23:09 -0800165 "//third_party/android_support_test_runner:rules_java",
166 "//third_party/android_support_test_runner:runner_java",
167 "//third_party/espresso:espresso_all_java",
168 "//third_party/hamcrest:hamcrest_java",
169 "//third_party/junit",
mandermoa6069e82017-01-16 02:23:09 -0800170 ]
171
172 data = [
Edward Lemur70ba9b42018-01-22 13:46:58 +0100173 "../build/android/adb_reverse_forwarder.py",
174 "../examples/androidtests/video_quality_loopback_test.py",
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200175 "../resources/reference_video_640x360_30fps.y4m",
Edward Lemur70ba9b42018-01-22 13:46:58 +0100176 "../rtc_tools/barcode_tools/barcode_decoder.py",
177 "../rtc_tools/barcode_tools/helper_functions.py",
178 "../rtc_tools/compare_videos.py",
179 "../rtc_tools/testing/prebuilt_apprtc.zip",
180 "../rtc_tools/testing/golang/linux/go.tar.gz",
181 "../rtc_tools/testing/build_apprtc.py",
182 "../rtc_tools/testing/utils.py",
183 "../tools_webrtc/video_quality_toolchain/linux/ffmpeg",
184 "../tools_webrtc/video_quality_toolchain/linux/frame_analyzer",
185 "../tools_webrtc/video_quality_toolchain/linux/zxing",
mandermoa6069e82017-01-16 02:23:09 -0800186 ]
187 }
Sami Kalliomaki9c0c75b2016-06-29 14:55:00 +0200188}
tkchin2ddfdba2016-08-07 21:37:45 -0700189
190if (is_ios || (is_mac && target_cpu != "x86")) {
tkchin2ddfdba2016-08-07 21:37:45 -0700191 config("apprtc_common_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200192 include_dirs = [ "objc/AppRTCMobile/common" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700193 }
194
kjellanderb62dbbe2016-09-23 00:38:52 -0700195 rtc_static_library("apprtc_common") {
kjellander1993b1d2017-03-06 00:29:21 -0800196 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700197 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200198 "objc/AppRTCMobile/common/ARDUtilities.h",
199 "objc/AppRTCMobile/common/ARDUtilities.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700200 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700201 public_configs = [ ":apprtc_common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700202
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200203 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100204 # iOS must use WebRTC.framework which is dynamically linked.
205 # 'gn check' is disabled in order to avoid confusion and
206 # errors caused by multiple implementations.
207 check_includes = false
kthelgason5901d9d2017-08-16 07:28:03 -0700208 deps = [
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100209 "../sdk:framework_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100210 "../system_wrappers:field_trial_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000211 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700212 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200213 } else {
kthelgason5901d9d2017-08-16 07:28:03 -0700214 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700215 "../sdk:common_objc",
kthelgason5901d9d2017-08-16 07:28:03 -0700216 "../system_wrappers:field_trial_default",
217 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000218 "../system_wrappers:runtime_enabled_features_default",
kthelgason5901d9d2017-08-16 07:28:03 -0700219 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200220 }
tkchin2ddfdba2016-08-07 21:37:45 -0700221 }
222
223 config("apprtc_signaling_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200224 include_dirs = [ "objc/AppRTCMobile" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700225
226 # GN orders flags on a target before flags from configs. The default config
227 # adds these flags so to cancel them out they need to come from a config and
228 # cannot be on the target directly.
229 cflags = [
230 "-Wno-sign-compare",
231 "-Wno-unused-variable",
232 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700233 }
234
kjellanderb62dbbe2016-09-23 00:38:52 -0700235 rtc_static_library("apprtc_signaling") {
kjellander1993b1d2017-03-06 00:29:21 -0800236 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700237 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200238 "objc/AppRTCMobile/ARDAppClient+Internal.h",
239 "objc/AppRTCMobile/ARDAppClient.h",
240 "objc/AppRTCMobile/ARDAppClient.m",
241 "objc/AppRTCMobile/ARDAppEngineClient.h",
242 "objc/AppRTCMobile/ARDAppEngineClient.m",
243 "objc/AppRTCMobile/ARDBitrateTracker.h",
244 "objc/AppRTCMobile/ARDBitrateTracker.m",
sakalc522e752017-04-05 12:17:48 -0700245 "objc/AppRTCMobile/ARDCaptureController.h",
246 "objc/AppRTCMobile/ARDCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200247 "objc/AppRTCMobile/ARDJoinResponse+Internal.h",
248 "objc/AppRTCMobile/ARDJoinResponse.h",
249 "objc/AppRTCMobile/ARDJoinResponse.m",
250 "objc/AppRTCMobile/ARDMessageResponse+Internal.h",
251 "objc/AppRTCMobile/ARDMessageResponse.h",
252 "objc/AppRTCMobile/ARDMessageResponse.m",
253 "objc/AppRTCMobile/ARDRoomServerClient.h",
sakalc4adacf2017-03-28 01:22:48 -0700254 "objc/AppRTCMobile/ARDSettingsModel+Private.h",
255 "objc/AppRTCMobile/ARDSettingsModel.h",
256 "objc/AppRTCMobile/ARDSettingsModel.m",
257 "objc/AppRTCMobile/ARDSettingsStore.h",
258 "objc/AppRTCMobile/ARDSettingsStore.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200259 "objc/AppRTCMobile/ARDSignalingChannel.h",
260 "objc/AppRTCMobile/ARDSignalingMessage.h",
261 "objc/AppRTCMobile/ARDSignalingMessage.m",
262 "objc/AppRTCMobile/ARDStatsBuilder.h",
263 "objc/AppRTCMobile/ARDStatsBuilder.m",
kthelgasoncc882af2017-01-13 05:59:46 -0800264 "objc/AppRTCMobile/ARDTURNClient+Internal.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200265 "objc/AppRTCMobile/ARDTURNClient.h",
kthelgasoncc882af2017-01-13 05:59:46 -0800266 "objc/AppRTCMobile/ARDTURNClient.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200267 "objc/AppRTCMobile/ARDWebSocketChannel.h",
268 "objc/AppRTCMobile/ARDWebSocketChannel.m",
269 "objc/AppRTCMobile/RTCIceCandidate+JSON.h",
270 "objc/AppRTCMobile/RTCIceCandidate+JSON.m",
271 "objc/AppRTCMobile/RTCIceServer+JSON.h",
272 "objc/AppRTCMobile/RTCIceServer+JSON.m",
273 "objc/AppRTCMobile/RTCMediaConstraints+JSON.h",
274 "objc/AppRTCMobile/RTCMediaConstraints+JSON.m",
275 "objc/AppRTCMobile/RTCSessionDescription+JSON.h",
276 "objc/AppRTCMobile/RTCSessionDescription+JSON.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700277 ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700278 public_configs = [ ":apprtc_signaling_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700279 deps = [
280 ":apprtc_common",
281 ":socketrocket",
282 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200283 if (is_ios) {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100284 # iOS must use WebRTC.framework which is dynamically linked.
285 # 'gn check' is disabled in order to avoid confusion and
286 # errors caused by multiple implementations.
287 check_includes = false
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100288 deps += [
289 ":AppRTCMobile_ios_frameworks",
290 "../sdk:framework_objc",
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200291 ]
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100292 } else {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100293 deps += [
294 "../sdk:common_objc",
295 "../sdk:mediaconstraints_objc",
296 "../sdk:peerconnectionfactory_base_objc",
297 "../sdk:videocapture_objc",
298 "../sdk:videocodec_objc",
Anders Carlsson9823ee42018-03-07 10:32:03 +0100299 "../sdk:videosource_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100300 ]
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200301 }
tkchin2ddfdba2016-08-07 21:37:45 -0700302 libs = [ "QuartzCore.framework" ]
303 }
304
305 if (is_ios) {
denicija77bfd7c2016-11-15 00:41:26 -0800306 rtc_static_library("AppRTCMobile_lib") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100307 # iOS must use WebRTC.framework which is dynamically linked.
308 # 'gn check' is disabled in order to avoid confusion and
309 # errors caused by multiple implementations.
310 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800311 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700312 sources = [
Patrik Höglund49acb1e2018-01-02 14:41:54 +0100313 "objc/AppRTCMobile/ios/ARDAppDelegate.h",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200314 "objc/AppRTCMobile/ios/ARDAppDelegate.m",
Daniela012b56b2017-11-15 13:15:24 +0100315 "objc/AppRTCMobile/ios/ARDFileCaptureController.h",
316 "objc/AppRTCMobile/ios/ARDFileCaptureController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200317 "objc/AppRTCMobile/ios/ARDMainView.h",
318 "objc/AppRTCMobile/ios/ARDMainView.m",
319 "objc/AppRTCMobile/ios/ARDMainViewController.h",
320 "objc/AppRTCMobile/ios/ARDMainViewController.m",
denicijad17d5362016-11-02 02:56:09 -0700321 "objc/AppRTCMobile/ios/ARDSettingsViewController.h",
322 "objc/AppRTCMobile/ios/ARDSettingsViewController.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200323 "objc/AppRTCMobile/ios/ARDStatsView.h",
324 "objc/AppRTCMobile/ios/ARDStatsView.m",
325 "objc/AppRTCMobile/ios/ARDVideoCallView.h",
326 "objc/AppRTCMobile/ios/ARDVideoCallView.m",
327 "objc/AppRTCMobile/ios/ARDVideoCallViewController.h",
328 "objc/AppRTCMobile/ios/ARDVideoCallViewController.m",
Anders Carlsson6bf43d22017-10-16 13:51:43 +0200329 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.h",
330 "objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200331 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
332 "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
denicija77bfd7c2016-11-15 00:41:26 -0800333 ]
denicija77bfd7c2016-11-15 00:41:26 -0800334
335 deps = [
Kári Tristan Helgason946923a2017-06-02 14:05:56 +0200336 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800337 ":apprtc_common",
338 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100339 "../sdk:framework_objc",
denicija77bfd7c2016-11-15 00:41:26 -0800340 ]
341 }
342
343 ios_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800344 testonly = true
denicija77bfd7c2016-11-15 00:41:26 -0800345 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200346 "objc/AppRTCMobile/ios/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700347 ]
348
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200349 info_plist = "objc/AppRTCMobile/ios/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700350
denicija77bfd7c2016-11-15 00:41:26 -0800351 configs += [ "..:common_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700352 public_configs = [ "..:common_inherited_config" ]
353
354 deps = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200355 ":AppRTCMobile_ios_bundle_data",
kthelgasond3adbfb2017-01-26 01:14:04 -0800356 ":AppRTCMobile_ios_frameworks",
denicija77bfd7c2016-11-15 00:41:26 -0800357 ":AppRTCMobile_lib",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100358 "../sdk:framework_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700359 ]
360
361 if (target_cpu == "x86") {
362 deps += [ "//testing/iossim:iossim" ]
363 }
364 }
365
kthelgasond3adbfb2017-01-26 01:14:04 -0800366 bundle_data("AppRTCMobile_ios_frameworks") {
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100367 deps = [
kthelgason36d658d2017-08-24 05:43:45 -0700368 "../sdk:framework_objc+link",
kthelgasond3adbfb2017-01-26 01:14:04 -0800369 ]
370 sources = [
wjywbsbef8a5d2017-10-09 02:32:28 -0400371 "$root_build_dir/WebRTC.framework",
kthelgasond3adbfb2017-01-26 01:14:04 -0800372 ]
373 outputs = [
374 "{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
375 ]
376 }
377
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200378 bundle_data("AppRTCMobile_ios_bundle_data") {
tkchin2ddfdba2016-08-07 21:37:45 -0700379 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200380 "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
Daniela012b56b2017-11-15 13:15:24 +0100381
382 # Sample video taken from https://media.xiph.org/video/derf/
383 "objc/AppRTCMobile/ios/resources/foreman.mp4",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200384 "objc/AppRTCMobile/ios/resources/iPhone5@2x.png",
385 "objc/AppRTCMobile/ios/resources/iPhone6@2x.png",
386 "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png",
387 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png",
388 "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png",
389 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png",
390 "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png",
denicija6d6762c2016-10-28 04:53:16 -0700391 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png",
392 "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png",
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200393 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png",
394 "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png",
395 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png",
396 "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png",
397 "objc/AppRTCMobile/ios/resources/mozart.mp3",
anderscb5ed9052017-08-15 04:07:12 -0700398 "objc/Icon-120.png",
399 "objc/Icon-180.png",
tkchin2ddfdba2016-08-07 21:37:45 -0700400 "objc/Icon.png",
401 ]
402 outputs = [
403 "{{bundle_resources_dir}}/{{source_file_part}}",
404 ]
405 }
Anders Carlsson73119182018-03-15 09:41:03 +0100406
407 rtc_static_library("ObjCNativeAPIDemo_lib") {
408 testonly = true
409 sources = [
410 "objcnativeapi/objc/NADAppDelegate.h",
411 "objcnativeapi/objc/NADAppDelegate.m",
412 "objcnativeapi/objc/NADViewController.h",
413 "objcnativeapi/objc/NADViewController.mm",
414 "objcnativeapi/objc/objccallclient.h",
415 "objcnativeapi/objc/objccallclient.mm",
416 ]
417
418 if (!build_with_chromium && is_clang) {
419 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
420 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
421 }
422
423 deps = [
424 "../api:libjingle_peerconnection_api",
425 "../api/audio_codecs:builtin_audio_decoder_factory",
426 "../api/audio_codecs:builtin_audio_encoder_factory",
427 "../logging:rtc_event_log_impl_base",
428 "../media:rtc_audio_video",
429 "../modules/audio_processing:audio_processing",
430 "../pc:libjingle_peerconnection",
431 "../rtc_base:rtc_base",
432 "../sdk:default_codec_factory_objc",
433 "../sdk:framework_objc",
434 "../sdk:native_api",
435 "../sdk:ui_objc",
436 "../sdk:videotoolbox_objc",
437 "../system_wrappers:field_trial_default",
438 "../system_wrappers:metrics_default",
439 "../system_wrappers:runtime_enabled_features_default",
440 ]
441
442 if (current_cpu == "arm64") {
443 deps += [ "../sdk:metal_objc" ]
444 }
445 }
446
447 ios_app_bundle("ObjCNativeAPIDemo") {
448 testonly = true
449 sources = [
450 "objcnativeapi/objc/main.m",
451 ]
452
453 info_plist = "objcnativeapi/Info.plist"
454
455 configs += [ "..:common_config" ]
456 public_configs = [ "..:common_inherited_config" ]
457
458 deps = [
459 ":ObjCNativeAPIDemo_lib",
460 ]
461
462 if (target_cpu == "x86") {
463 deps += [ "//testing/iossim:iossim" ]
464 }
465 }
tkchin2ddfdba2016-08-07 21:37:45 -0700466 }
467
468 if (is_mac) {
denicija77bfd7c2016-11-15 00:41:26 -0800469 rtc_static_library("AppRTCMobile_lib") {
kjellander1993b1d2017-03-06 00:29:21 -0800470 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700471 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200472 "objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
473 "objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
474 "objc/AppRTCMobile/mac/APPRTCViewController.h",
475 "objc/AppRTCMobile/mac/APPRTCViewController.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700476 ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700477 configs += [ "..:common_objc" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700478 deps = [
479 ":apprtc_common",
480 ":apprtc_signaling",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100481 "../sdk:default_codec_factory_objc",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100482 "../sdk:metal_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100483 "../sdk:peerconnectionfactory_base_objc",
kthelgason36d658d2017-08-24 05:43:45 -0700484 "../sdk:ui_objc",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100485 "../sdk:videocapture_objc",
486 "../sdk:videocodec_objc",
Kári Tristan Helgason99bf77c2018-02-16 10:49:22 +0100487 "../sdk:videocodec_objc",
488 "../sdk:videotoolbox_objc",
tkchin2ddfdba2016-08-07 21:37:45 -0700489 ]
490 }
491
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200492 mac_app_bundle("AppRTCMobile") {
kjellander1993b1d2017-03-06 00:29:21 -0800493 testonly = true
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200494 output_name = "AppRTCMobile"
tkchin2ddfdba2016-08-07 21:37:45 -0700495
tkchin2ddfdba2016-08-07 21:37:45 -0700496 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200497 "objc/AppRTCMobile/mac/main.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700498 ]
499
500 public_configs = [ "..:common_inherited_config" ]
501
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200502 info_plist = "objc/AppRTCMobile/mac/Info.plist"
tkchin2ddfdba2016-08-07 21:37:45 -0700503
504 libs = [ "AppKit.framework" ]
505
506 deps = [
denicija77bfd7c2016-11-15 00:41:26 -0800507 ":AppRTCMobile_lib",
tkchin2ddfdba2016-08-07 21:37:45 -0700508 ]
509 }
510 }
511
512 config("socketrocket_include_config") {
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200513 include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700514 }
515
516 config("socketrocket_warning_config") {
517 # GN orders flags on a target before flags from configs. The default config
518 # adds these flags so to cancel them out they need to come from a config and
519 # cannot be on the target directly.
520 cflags = [
521 "-Wno-deprecated-declarations",
522 "-Wno-nonnull",
tkchin2ddfdba2016-08-07 21:37:45 -0700523 "-Wno-semicolon-before-method-body",
kthelgasone47de1a2017-02-24 01:56:01 -0800524 "-Wno-unused-variable",
tkchin2ddfdba2016-08-07 21:37:45 -0700525 ]
526
henrika27d8b612016-09-21 04:13:00 -0700527 cflags_objc = [
528 # Enabled for cflags_objc in build/config/compiler/BUILD.gn.
529 "-Wno-objc-missing-property-synthesis",
henrika27d8b612016-09-21 04:13:00 -0700530 ]
tkchin2ddfdba2016-08-07 21:37:45 -0700531 }
532
kjellanderb62dbbe2016-09-23 00:38:52 -0700533 rtc_static_library("socketrocket") {
kjellander1993b1d2017-03-06 00:29:21 -0800534 testonly = true
tkchin2ddfdba2016-08-07 21:37:45 -0700535 sources = [
Magnus Jedvertc1815cf2016-09-27 10:10:41 +0200536 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h",
537 "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m",
tkchin2ddfdba2016-08-07 21:37:45 -0700538 ]
kthelgasonc0977102017-04-24 00:57:16 -0700539 configs += [ ":socketrocket_warning_config" ]
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700540 public_configs = [ ":socketrocket_include_config" ]
tkchin2ddfdba2016-08-07 21:37:45 -0700541
542 libs = [
543 "CFNetwork.framework",
544 "icucore",
545 ]
546 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800547
548 if (rtc_include_tests) {
kthelgason4065a572017-02-14 04:58:56 -0800549 # TODO(kthelgason): compile xctests on mac when chromium supports it.
550 if (is_ios) {
551 rtc_source_set("apprtcmobile_test_sources") {
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100552 # iOS must use WebRTC.framework which is dynamically linked.
553 # 'gn check' is disabled in order to avoid confusion and
554 # errors caused by multiple implementations.
555 check_includes = false
kjellander1993b1d2017-03-06 00:29:21 -0800556 testonly = true
kthelgason4065a572017-02-14 04:58:56 -0800557 include_dirs = [
558 "objc/AppRTCMobile",
559 "objc/AppRTCMobile/ios",
560 ]
561 testonly = true
562 sources = [
563 "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
Daniela012b56b2017-11-15 13:15:24 +0100564 "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
kthelgason4065a572017-02-14 04:58:56 -0800565 "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
566 ]
kjellander1993b1d2017-03-06 00:29:21 -0800567 deps = [
kthelgason4065a572017-02-14 04:58:56 -0800568 ":AppRTCMobile_ios_frameworks",
569 ":AppRTCMobile_lib",
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100570 ":apprtc_signaling",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100571 "../rtc_base:rtc_base",
572 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800573 "//build/config/ios:xctest",
574 "//third_party/ocmock",
575 ]
adam.fedorbcc5d872016-11-07 14:53:28 -0800576 }
577
kthelgason4065a572017-02-14 04:58:56 -0800578 rtc_ios_xctest_test("apprtcmobile_tests") {
579 info_plist = "objc/AppRTCMobile/ios/Info.plist"
580 sources = [
581 "objc/AppRTCMobile/ios/main.m",
582 ]
583 deps = [
Mirko Bonadeicbaaaed2018-02-19 15:14:04 +0100584 ":AppRTCMobile_lib",
kthelgason4065a572017-02-14 04:58:56 -0800585 ":apprtcmobile_test_sources",
Mirko Bonadei1a339c32017-12-14 13:06:10 +0100586 "../sdk:framework_objc",
kthelgason4065a572017-02-14 04:58:56 -0800587 ]
588 ldflags = [ "-all_load" ]
589 }
adam.fedorbcc5d872016-11-07 14:53:28 -0800590 }
591 }
tkchin2ddfdba2016-08-07 21:37:45 -0700592}
kthelgason0727f152016-08-08 09:03:23 -0700593
594if (is_linux || is_win) {
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700595 config("peerconnection_client_warnings_config") {
kjellander4a9abad2016-09-18 08:12:29 -0700596 cflags = []
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700597 if (is_win && is_clang) {
kjellander4a9abad2016-09-18 08:12:29 -0700598 cflags += [
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700599 # Disable warnings failing when compiling with Clang on Windows.
600 # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
601 "-Wno-format",
602
603 # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271
604 # for -Wno-reorder and -Wno-sign-compare
605 "-Wno-reorder",
606 "-Wno-sign-compare",
607 ]
608 }
kjellanderd4626e52016-09-07 02:33:01 -0700609 if (is_linux && target_cpu == "x86") {
kjellander4a9abad2016-09-18 08:12:29 -0700610 cflags += [
kjellanderd4626e52016-09-07 02:33:01 -0700611 # Needed to compile on Linux 32-bit.
612 "-Wno-sentinel",
613 ]
614 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700615 }
616
ehmaldonado38a21322016-09-02 04:10:34 -0700617 rtc_executable("peerconnection_client") {
kjellander1993b1d2017-03-06 00:29:21 -0800618 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700619 sources = [
620 "peerconnection/client/conductor.cc",
621 "peerconnection/client/conductor.h",
622 "peerconnection/client/defaults.cc",
623 "peerconnection/client/defaults.h",
624 "peerconnection/client/peer_connection_client.cc",
625 "peerconnection/client/peer_connection_client.h",
626 ]
ehmaldonado7a2ce0b2016-09-05 01:35:44 -0700627
kjellandere40a7ee2016-10-16 23:56:12 -0700628 if (!build_with_chromium && is_clang) {
629 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700630 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700631 }
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100632 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100633 "../api:libjingle_peerconnection_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100634 "../api:video_frame_api_i420",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100635 "../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100636 "../rtc_base:stringutils",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100637 ]
kthelgason0727f152016-08-08 09:03:23 -0700638 if (is_win) {
639 sources += [
640 "peerconnection/client/flagdefs.h",
641 "peerconnection/client/main.cc",
642 "peerconnection/client/main_wnd.cc",
643 "peerconnection/client/main_wnd.h",
644 ]
645 cflags = [ "/wd4245" ]
646 configs += [ "//build/config/win:windowed" ]
jianjun.zhuc0247402017-07-11 06:20:45 -0700647 deps += [ "../media:rtc_media_base" ]
kthelgason0727f152016-08-08 09:03:23 -0700648 }
649 if (is_linux) {
650 sources += [
651 "peerconnection/client/linux/main.cc",
652 "peerconnection/client/linux/main_wnd.cc",
653 "peerconnection/client/linux/main_wnd.h",
654 ]
Henrik Kjellanderefbde2c2017-03-27 08:28:27 +0200655 cflags = [ "-Wno-deprecated-declarations" ]
kthelgason0727f152016-08-08 09:03:23 -0700656 libs = [
657 "X11",
658 "Xcomposite",
659 "Xext",
660 "Xrender",
661 ]
thomasandersonef16e992016-12-13 02:57:43 -0800662 deps += [ "//build/config/linux/gtk" ]
kthelgason0727f152016-08-08 09:03:23 -0700663 }
ehmaldonadod02fe4b2016-08-26 13:31:24 -0700664 configs += [ ":peerconnection_client_warnings_config" ]
kjellander1993b1d2017-03-06 00:29:21 -0800665
666 deps += [
Niels Möller8366e172018-02-14 12:20:13 +0100667 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700668 "../api:libjingle_peerconnection_test_api",
669 "../api:video_frame_api",
Karl Wiberg1b0eae32017-10-17 14:48:54 +0200670 "../api/audio_codecs:builtin_audio_decoder_factory",
671 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100672 "../media:rtc_audio_video",
jianjun.zhuc0247402017-07-11 06:20:45 -0700673 "../modules/video_capture:video_capture_module",
674 "../pc:libjingle_peerconnection",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700675 "../rtc_base:rtc_base",
676 "../rtc_base:rtc_base_approved",
677 "../rtc_base:rtc_json",
jianjun.zhuc0247402017-07-11 06:20:45 -0700678 "../system_wrappers:field_trial_default",
679 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000680 "../system_wrappers:runtime_enabled_features_default",
kjellander1993b1d2017-03-06 00:29:21 -0800681 "//third_party/libyuv",
kjellander1993b1d2017-03-06 00:29:21 -0800682 ]
kthelgason0727f152016-08-08 09:03:23 -0700683 }
kjellanderd4626e52016-09-07 02:33:01 -0700684
ehmaldonado38a21322016-09-02 04:10:34 -0700685 rtc_executable("peerconnection_server") {
kjellander1993b1d2017-03-06 00:29:21 -0800686 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700687 sources = [
688 "peerconnection/server/data_socket.cc",
689 "peerconnection/server/data_socket.h",
690 "peerconnection/server/main.cc",
691 "peerconnection/server/peer_channel.cc",
692 "peerconnection/server/peer_channel.h",
693 "peerconnection/server/utils.cc",
694 "peerconnection/server/utils.h",
695 ]
696 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700697 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700698 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100699 "../rtc_base:stringutils",
jianjun.zhuc0247402017-07-11 06:20:45 -0700700 "../rtc_tools:command_line_parser",
kthelgason0727f152016-08-08 09:03:23 -0700701 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700702 if (!build_with_chromium && is_clang) {
703 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700704 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700705 }
706 }
ehmaldonado38a21322016-09-02 04:10:34 -0700707 rtc_executable("relayserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800708 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700709 sources = [
710 "relayserver/relayserver_main.cc",
711 ]
712 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700713 "../p2p:rtc_p2p",
714 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700715 "../rtc_base:rtc_base",
716 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700717 "../system_wrappers:field_trial_default",
718 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000719 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700720 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700721 if (!build_with_chromium && is_clang) {
722 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700723 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700724 }
725 }
ehmaldonado38a21322016-09-02 04:10:34 -0700726 rtc_executable("turnserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800727 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700728 sources = [
729 "turnserver/turnserver_main.cc",
730 ]
731 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700732 "../p2p:rtc_p2p",
733 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700734 "../rtc_base:rtc_base",
735 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700736 "../system_wrappers:field_trial_default",
737 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000738 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700739 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700740 if (!build_with_chromium && is_clang) {
741 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700742 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700743 }
744 }
ehmaldonado38a21322016-09-02 04:10:34 -0700745 rtc_executable("stunserver") {
kjellander1993b1d2017-03-06 00:29:21 -0800746 testonly = true
kthelgason0727f152016-08-08 09:03:23 -0700747 sources = [
748 "stunserver/stunserver_main.cc",
749 ]
750 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700751 "../p2p:rtc_p2p",
752 "../pc:rtc_pc",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700753 "../rtc_base:rtc_base",
754 "../rtc_base:rtc_base_approved",
jianjun.zhuc0247402017-07-11 06:20:45 -0700755 "../system_wrappers:field_trial_default",
756 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000757 "../system_wrappers:runtime_enabled_features_default",
kthelgason0727f152016-08-08 09:03:23 -0700758 ]
kjellandere40a7ee2016-10-16 23:56:12 -0700759 if (!build_with_chromium && is_clang) {
760 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700761 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kthelgason0727f152016-08-08 09:03:23 -0700762 }
763 }
764}
charujainaca3a242016-11-01 03:09:15 -0700765
qiangchen42f96d52017-08-08 17:08:03 -0700766if (is_win || is_android) {
gyzhouad7cad82017-05-11 16:10:03 -0700767 rtc_shared_library("webrtc_unity_plugin") {
768 testonly = true
769 sources = [
770 "unityplugin/simple_peer_connection.cc",
771 "unityplugin/simple_peer_connection.h",
772 "unityplugin/unity_plugin_apis.cc",
773 "unityplugin/unity_plugin_apis.h",
gyzhoub38f3862017-07-25 16:04:31 -0700774 "unityplugin/video_observer.cc",
775 "unityplugin/video_observer.h",
gyzhouad7cad82017-05-11 16:10:03 -0700776 ]
qiangchen42f96d52017-08-08 17:08:03 -0700777
778 if (is_android) {
779 sources += [
780 "unityplugin/classreferenceholder.cc",
781 "unityplugin/classreferenceholder.h",
782 "unityplugin/jni_onload.cc",
783 ]
Qiang Chen43fb9122017-12-20 10:47:36 -0800784 suppressed_configs += [ "//build/config/android:hide_all_but_jni_onload" ]
qiangchen42f96d52017-08-08 17:08:03 -0700785 }
786
gyzhouad7cad82017-05-11 16:10:03 -0700787 if (!build_with_chromium && is_clang) {
788 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
789 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
790 }
qiangchen42f96d52017-08-08 17:08:03 -0700791 if (is_win) {
792 cflags = [ "/wd4245" ]
793 configs += [
794 "//build/config/win:windowed",
795 ":peerconnection_client_warnings_config",
796 ]
797 }
gyzhouad7cad82017-05-11 16:10:03 -0700798 deps = [
Mirko Bonadei34814c72018-01-11 10:13:56 +0100799 "../api:libjingle_peerconnection_api",
jianjun.zhuc0247402017-07-11 06:20:45 -0700800 "../api:libjingle_peerconnection_test_api",
801 "../api:video_frame_api",
Qiang Chen51e20462017-12-05 11:11:21 -0800802 "../api/audio_codecs:builtin_audio_decoder_factory",
803 "../api/audio_codecs:builtin_audio_encoder_factory",
Mirko Bonadei75baa492018-01-11 17:07:30 +0100804 "../media:rtc_audio_video",
Anders Carlssona114c882018-01-04 15:10:22 +0100805 "../media:rtc_internal_video_codecs",
jianjun.zhuc0247402017-07-11 06:20:45 -0700806 "../media:rtc_media",
807 "../media:rtc_media_base",
Qiang Chen43fb9122017-12-20 10:47:36 -0800808 "../modules/audio_device:audio_device",
809 "../modules/audio_processing:audio_processing",
jianjun.zhuc0247402017-07-11 06:20:45 -0700810 "../modules/video_capture:video_capture_module",
811 "../pc:libjingle_peerconnection",
qiangchen42f96d52017-08-08 17:08:03 -0700812 "../rtc_base:rtc_base",
jianjun.zhuc0247402017-07-11 06:20:45 -0700813 "../system_wrappers:field_trial_default",
814 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000815 "../system_wrappers:runtime_enabled_features_default",
gyzhouad7cad82017-05-11 16:10:03 -0700816 ]
qiangchen42f96d52017-08-08 17:08:03 -0700817 if (is_android) {
George Zhou2770c3d2018-03-07 09:58:54 -0800818 deps += [
819 "../modules/utility:utility",
820 "../sdk/android:libjingle_peerconnection_jni",
821 ]
qiangchen42f96d52017-08-08 17:08:03 -0700822 }
823 }
824}
825
826if (is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000827 rtc_android_library("webrtc_unity_java") {
qiangchen42f96d52017-08-08 17:08:03 -0700828 java_files = [ "unityplugin/java/src/org/webrtc/UnityUtility.java" ]
829 deps = [
830 "../rtc_base:base_java",
831 "../sdk/android:libjingle_peerconnection_java",
832 ]
833 }
834
835 dist_jar("libwebrtc_unity") {
836 _target_dir_name = get_label_info(":$target_name", "dir")
837 output = "${root_out_dir}/lib.java${_target_dir_name}/${target_name}.jar"
George Zhou2770c3d2018-03-07 09:58:54 -0800838 direct_deps_only = false
qiangchen42f96d52017-08-08 17:08:03 -0700839 use_interface_jars = false
George Zhou2770c3d2018-03-07 09:58:54 -0800840 use_unprocessed_jars = false
Oleh Prypin86021d92017-09-24 22:29:06 +0200841 requires_android = true
qiangchen42f96d52017-08-08 17:08:03 -0700842 deps = [
843 ":webrtc_unity_java",
Paulina Hensman17071682018-03-26 16:10:29 +0200844 "../modules/audio_device:audio_device_java",
qiangchen42f96d52017-08-08 17:08:03 -0700845 "../rtc_base:base_java",
846 "../sdk/android:libjingle_peerconnection_java",
847 "../sdk/android:libjingle_peerconnection_metrics_default_java",
848 ]
gyzhouad7cad82017-05-11 16:10:03 -0700849 }
850}
851
charujainaca3a242016-11-01 03:09:15 -0700852if (!build_with_chromium) {
853 # Doesn't build within Chrome on Win.
854 rtc_executable("stun_prober") {
kjellander1993b1d2017-03-06 00:29:21 -0800855 testonly = true
charujainaca3a242016-11-01 03:09:15 -0700856 sources = [
857 "stunprober/main.cc",
858 ]
859
860 if (!build_with_chromium && is_clang) {
861 # Suppress warnings from Chrome's Clang plugins.
862 # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
863 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
864 }
865
866 deps = [
867 "../p2p:libstunprober",
868 "../p2p:rtc_p2p",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100869 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700870 "../rtc_base:rtc_base",
871 "../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100872 "../rtc_base:stringutils",
charujainaca3a242016-11-01 03:09:15 -0700873 "../system_wrappers:field_trial_default",
874 ]
875 }
876}