Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [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 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 9 | import("../build/webrtc.gni") |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 10 | if (is_android) { |
| 11 | import("//build/config/android/config.gni") |
| 12 | import("//build/config/android/rules.gni") |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 13 | } else if (is_mac) { |
| 14 | import("//build/config/mac/rules.gni") |
| 15 | } else if (is_ios) { |
| 16 | import("//build/config/ios/rules.gni") |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | group("examples") { |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 20 | # This target shall build all targets in examples. |
| 21 | testonly = true |
kjellander | 705ecc5 | 2016-09-15 00:53:26 -0700 | [diff] [blame] | 22 | public_deps = [] |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 23 | |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 24 | if (is_android) { |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 25 | public_deps += [ |
| 26 | ":AppRTCMobile", |
| 27 | ":AppRTCMobileTest", |
mandermo | a6069e8 | 2017-01-16 02:23:09 -0800 | [diff] [blame] | 28 | ":AppRTCMobileTestStubbedVideoIO", |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 29 | ] |
| 30 | } |
| 31 | |
charujain | aca3a24 | 2016-11-01 03:09:15 -0700 | [diff] [blame] | 32 | if (!build_with_chromium) { |
| 33 | public_deps += [ ":stun_prober" ] |
| 34 | } |
| 35 | |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 36 | if (is_ios || (is_mac && target_cpu != "x86")) { |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 37 | public_deps += [ ":AppRTCMobile" ] |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 38 | } |
kjellander | 6ceab08 | 2016-10-28 05:44:03 -0700 | [diff] [blame] | 39 | |
| 40 | if (is_linux || is_win) { |
kjellander | 705ecc5 | 2016-09-15 00:53:26 -0700 | [diff] [blame] | 41 | public_deps += [ |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 42 | ":peerconnection_client", |
| 43 | ":peerconnection_server", |
| 44 | ":relayserver", |
| 45 | ":stunserver", |
| 46 | ":turnserver", |
| 47 | ] |
| 48 | } |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 49 | } |
| 50 | |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 51 | if (is_android) { |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 52 | android_apk("AppRTCMobile") { |
| 53 | apk_name = "AppRTCMobile" |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 54 | android_manifest = "androidapp/AndroidManifest.xml" |
| 55 | |
| 56 | deps = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 57 | ":AppRTCMobile_javalib", |
| 58 | ":AppRTCMobile_resources", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 59 | "//base:base_java", |
| 60 | "//webrtc/base:base_java", |
| 61 | ] |
| 62 | |
magjed | 768c648 | 2016-12-06 04:29:37 -0800 | [diff] [blame] | 63 | shared_libraries = [ "//webrtc/sdk/android:libjingle_peerconnection_so" ] |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 64 | } |
| 65 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 66 | android_library("AppRTCMobile_javalib") { |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 67 | java_files = [ |
| 68 | "androidapp/src/org/appspot/apprtc/AppRTCAudioManager.java", |
henrika | c3c2f31 | 2016-12-14 07:36:56 -0800 | [diff] [blame] | 69 | "androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 70 | "androidapp/src/org/appspot/apprtc/AppRTCClient.java", |
| 71 | "androidapp/src/org/appspot/apprtc/AppRTCProximitySensor.java", |
| 72 | "androidapp/src/org/appspot/apprtc/CallActivity.java", |
| 73 | "androidapp/src/org/appspot/apprtc/CallFragment.java", |
| 74 | "androidapp/src/org/appspot/apprtc/CaptureQualityController.java", |
| 75 | "androidapp/src/org/appspot/apprtc/ConnectActivity.java", |
| 76 | "androidapp/src/org/appspot/apprtc/CpuMonitor.java", |
| 77 | "androidapp/src/org/appspot/apprtc/DirectRTCClient.java", |
| 78 | "androidapp/src/org/appspot/apprtc/HudFragment.java", |
| 79 | "androidapp/src/org/appspot/apprtc/PeerConnectionClient.java", |
| 80 | "androidapp/src/org/appspot/apprtc/PercentFrameLayout.java", |
| 81 | "androidapp/src/org/appspot/apprtc/RoomParametersFetcher.java", |
| 82 | "androidapp/src/org/appspot/apprtc/SettingsActivity.java", |
| 83 | "androidapp/src/org/appspot/apprtc/SettingsFragment.java", |
| 84 | "androidapp/src/org/appspot/apprtc/TCPChannelClient.java", |
| 85 | "androidapp/src/org/appspot/apprtc/UnhandledExceptionHandler.java", |
| 86 | "androidapp/src/org/appspot/apprtc/WebSocketChannelClient.java", |
| 87 | "androidapp/src/org/appspot/apprtc/WebSocketRTCClient.java", |
| 88 | "androidapp/src/org/appspot/apprtc/util/AppRTCUtils.java", |
| 89 | "androidapp/src/org/appspot/apprtc/util/AsyncHttpURLConnection.java", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 90 | ] |
| 91 | |
| 92 | deps = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 93 | ":AppRTCMobile_resources", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 94 | "//webrtc/base:base_java", |
| 95 | "//webrtc/examples/androidapp/third_party/autobanh:autobanh_java", |
mbonadei | b55bd97 | 2017-01-23 01:25:53 -0800 | [diff] [blame] | 96 | "//webrtc/modules/audio_device:audio_device_java", |
magjed | 768c648 | 2016-12-06 04:29:37 -0800 | [diff] [blame] | 97 | "//webrtc/sdk/android:libjingle_peerconnection_java", |
| 98 | "//webrtc/sdk/android:libjingle_peerconnection_metrics_default_java", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 99 | ] |
| 100 | } |
| 101 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 102 | android_resources("AppRTCMobile_resources") { |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 103 | resource_dirs = [ "androidapp/res" ] |
| 104 | custom_package = "org.appspot.apprtc" |
| 105 | } |
| 106 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 107 | instrumentation_test_apk("AppRTCMobileTest") { |
| 108 | apk_name = "AppRTCMobileTest" |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 109 | android_manifest = "androidtests/AndroidManifest.xml" |
| 110 | |
sakal | e8aca24 | 2017-01-17 03:32:06 -0800 | [diff] [blame] | 111 | java_files = [ "androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java" ] |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 112 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 113 | apk_under_test = ":AppRTCMobile" |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 114 | |
| 115 | deps = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 116 | ":AppRTCMobile_javalib", |
sakal | cb79d51 | 2017-01-11 06:21:26 -0800 | [diff] [blame] | 117 | "//base:base_java_test_support", |
| 118 | "//third_party/android_support_test_runner:runner_java", |
| 119 | "//third_party/junit", |
magjed | 768c648 | 2016-12-06 04:29:37 -0800 | [diff] [blame] | 120 | "//webrtc/sdk/android:libjingle_peerconnection_java", |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 121 | ] |
| 122 | } |
mandermo | a6069e8 | 2017-01-16 02:23:09 -0800 | [diff] [blame] | 123 | |
| 124 | instrumentation_test_apk("AppRTCMobileTestStubbedVideoIO") { |
| 125 | apk_name = "AppRTCMobileTestStubbedVideoIO" |
| 126 | android_manifest = "androidtests/AndroidManifest.xml" |
| 127 | |
| 128 | java_files = [ "androidtests/src/org/appspot/apprtc/test/ConnectActivityStubbedInputOutputTest.java" ] |
| 129 | |
| 130 | apk_under_test = ":AppRTCMobile" |
| 131 | |
| 132 | deps = [ |
| 133 | ":AppRTCMobile_javalib", |
| 134 | "//third_party/android_support_test_runner:rules_java", |
| 135 | "//third_party/android_support_test_runner:runner_java", |
| 136 | "//third_party/espresso:espresso_all_java", |
| 137 | "//third_party/hamcrest:hamcrest_java", |
| 138 | "//third_party/junit", |
| 139 | "//webrtc/sdk/android:libjingle_peerconnection_java", |
| 140 | ] |
| 141 | |
| 142 | data = [ |
| 143 | "//resources/reference_video_640x360_30fps.y4m", |
| 144 | ] |
| 145 | } |
Sami Kalliomaki | 9c0c75b | 2016-06-29 14:55:00 +0200 | [diff] [blame] | 146 | } |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 147 | |
| 148 | if (is_ios || (is_mac && target_cpu != "x86")) { |
| 149 | config("warnings_config") { |
| 150 | # GN orders flags on a target before flags from configs. The default config |
| 151 | # adds these flags so to cancel them out they need to come from a config and |
| 152 | # cannot be on the target directly. |
| 153 | if (is_ios) { |
| 154 | # Suppress compiler warnings about deprecated that triggered |
| 155 | # when moving from ios_deployment_target 7.0 to 9.0. |
| 156 | # See webrtc:5549 for more details. |
| 157 | cflags = [ "-Wno-deprecated-declarations" ] |
Henrik Kjellander | 91a5759 | 2016-10-12 20:25:34 -0700 | [diff] [blame] | 158 | cflags_objc = [ |
| 159 | # Enabled for cflags_objc in build/config/compiler/BUILD.gn. |
| 160 | # See webrtc:6520. |
| 161 | "-Wno-objc-missing-property-synthesis", |
| 162 | ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 163 | } |
| 164 | } |
| 165 | |
| 166 | config("apprtc_common_config") { |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 167 | include_dirs = [ "objc/AppRTCMobile/common" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 168 | } |
| 169 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 170 | rtc_static_library("apprtc_common") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 171 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 172 | "objc/AppRTCMobile/common/ARDUtilities.h", |
| 173 | "objc/AppRTCMobile/common/ARDUtilities.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 174 | ] |
| 175 | configs += [ |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 176 | ":warnings_config", |
| 177 | "//build/config/compiler:enable_arc", |
| 178 | ] |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 179 | public_configs = [ ":apprtc_common_config" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 180 | |
| 181 | deps = [ |
| 182 | "../sdk:rtc_sdk_common_objc", |
| 183 | "../system_wrappers:field_trial_default", |
| 184 | "../system_wrappers:metrics_default", |
| 185 | ] |
| 186 | } |
| 187 | |
| 188 | config("apprtc_signaling_config") { |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 189 | include_dirs = [ "objc/AppRTCMobile" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 190 | |
| 191 | # GN orders flags on a target before flags from configs. The default config |
| 192 | # adds these flags so to cancel them out they need to come from a config and |
| 193 | # cannot be on the target directly. |
| 194 | cflags = [ |
| 195 | "-Wno-sign-compare", |
| 196 | "-Wno-unused-variable", |
| 197 | ] |
| 198 | if (is_mac) { |
| 199 | cflags += [ "-Wno-partial-availability" ] |
| 200 | } |
| 201 | } |
| 202 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 203 | rtc_static_library("apprtc_signaling") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 204 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 205 | "objc/AppRTCMobile/ARDAppClient+Internal.h", |
| 206 | "objc/AppRTCMobile/ARDAppClient.h", |
| 207 | "objc/AppRTCMobile/ARDAppClient.m", |
| 208 | "objc/AppRTCMobile/ARDAppEngineClient.h", |
| 209 | "objc/AppRTCMobile/ARDAppEngineClient.m", |
| 210 | "objc/AppRTCMobile/ARDBitrateTracker.h", |
| 211 | "objc/AppRTCMobile/ARDBitrateTracker.m", |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 212 | "objc/AppRTCMobile/ARDJoinResponse+Internal.h", |
| 213 | "objc/AppRTCMobile/ARDJoinResponse.h", |
| 214 | "objc/AppRTCMobile/ARDJoinResponse.m", |
| 215 | "objc/AppRTCMobile/ARDMessageResponse+Internal.h", |
| 216 | "objc/AppRTCMobile/ARDMessageResponse.h", |
| 217 | "objc/AppRTCMobile/ARDMessageResponse.m", |
| 218 | "objc/AppRTCMobile/ARDRoomServerClient.h", |
| 219 | "objc/AppRTCMobile/ARDSDPUtils.h", |
| 220 | "objc/AppRTCMobile/ARDSDPUtils.m", |
| 221 | "objc/AppRTCMobile/ARDSignalingChannel.h", |
| 222 | "objc/AppRTCMobile/ARDSignalingMessage.h", |
| 223 | "objc/AppRTCMobile/ARDSignalingMessage.m", |
| 224 | "objc/AppRTCMobile/ARDStatsBuilder.h", |
| 225 | "objc/AppRTCMobile/ARDStatsBuilder.m", |
kthelgason | cc882af | 2017-01-13 05:59:46 -0800 | [diff] [blame] | 226 | "objc/AppRTCMobile/ARDTURNClient+Internal.h", |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 227 | "objc/AppRTCMobile/ARDTURNClient.h", |
kthelgason | cc882af | 2017-01-13 05:59:46 -0800 | [diff] [blame] | 228 | "objc/AppRTCMobile/ARDTURNClient.m", |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 229 | "objc/AppRTCMobile/ARDWebSocketChannel.h", |
| 230 | "objc/AppRTCMobile/ARDWebSocketChannel.m", |
| 231 | "objc/AppRTCMobile/RTCIceCandidate+JSON.h", |
| 232 | "objc/AppRTCMobile/RTCIceCandidate+JSON.m", |
| 233 | "objc/AppRTCMobile/RTCIceServer+JSON.h", |
| 234 | "objc/AppRTCMobile/RTCIceServer+JSON.m", |
| 235 | "objc/AppRTCMobile/RTCMediaConstraints+JSON.h", |
| 236 | "objc/AppRTCMobile/RTCMediaConstraints+JSON.m", |
| 237 | "objc/AppRTCMobile/RTCSessionDescription+JSON.h", |
| 238 | "objc/AppRTCMobile/RTCSessionDescription+JSON.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 239 | ] |
| 240 | configs += [ |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 241 | "//build/config/compiler:enable_arc", |
| 242 | ":warnings_config", |
| 243 | ] |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 244 | public_configs = [ ":apprtc_signaling_config" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 245 | deps = [ |
| 246 | ":apprtc_common", |
| 247 | ":socketrocket", |
| 248 | ] |
| 249 | public_deps = [ |
| 250 | "../sdk:rtc_sdk_peerconnection_objc", |
| 251 | ] |
| 252 | libs = [ "QuartzCore.framework" ] |
| 253 | } |
| 254 | |
| 255 | if (is_ios) { |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 256 | rtc_static_library("AppRTCMobile_lib") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 257 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 258 | "objc/AppRTCMobile/ios/ARDAppDelegate.m", |
| 259 | "objc/AppRTCMobile/ios/ARDMainView.h", |
| 260 | "objc/AppRTCMobile/ios/ARDMainView.m", |
| 261 | "objc/AppRTCMobile/ios/ARDMainViewController.h", |
| 262 | "objc/AppRTCMobile/ios/ARDMainViewController.m", |
denicija | 2256e04 | 2016-11-09 06:26:18 -0800 | [diff] [blame] | 263 | "objc/AppRTCMobile/ios/ARDSettingsModel+Private.h", |
| 264 | "objc/AppRTCMobile/ios/ARDSettingsModel.h", |
| 265 | "objc/AppRTCMobile/ios/ARDSettingsModel.m", |
| 266 | "objc/AppRTCMobile/ios/ARDSettingsStore.h", |
| 267 | "objc/AppRTCMobile/ios/ARDSettingsStore.m", |
denicija | d17d536 | 2016-11-02 02:56:09 -0700 | [diff] [blame] | 268 | "objc/AppRTCMobile/ios/ARDSettingsViewController.h", |
| 269 | "objc/AppRTCMobile/ios/ARDSettingsViewController.m", |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 270 | "objc/AppRTCMobile/ios/ARDStatsView.h", |
| 271 | "objc/AppRTCMobile/ios/ARDStatsView.m", |
| 272 | "objc/AppRTCMobile/ios/ARDVideoCallView.h", |
| 273 | "objc/AppRTCMobile/ios/ARDVideoCallView.m", |
| 274 | "objc/AppRTCMobile/ios/ARDVideoCallViewController.h", |
| 275 | "objc/AppRTCMobile/ios/ARDVideoCallViewController.m", |
| 276 | "objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch", |
| 277 | "objc/AppRTCMobile/ios/UIImage+ARDUtilities.h", |
| 278 | "objc/AppRTCMobile/ios/UIImage+ARDUtilities.m", |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 279 | ] |
| 280 | configs += [ |
| 281 | "//build/config/compiler:enable_arc", |
| 282 | ":warnings_config", |
| 283 | ] |
| 284 | |
| 285 | deps = [ |
| 286 | ":apprtc_common", |
| 287 | ":apprtc_signaling", |
| 288 | ] |
| 289 | } |
| 290 | |
| 291 | ios_app_bundle("AppRTCMobile") { |
| 292 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 293 | "objc/AppRTCMobile/ios/main.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 294 | ] |
| 295 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 296 | info_plist = "objc/AppRTCMobile/ios/Info.plist" |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 297 | |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 298 | configs += [ "..:common_config" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 299 | public_configs = [ "..:common_inherited_config" ] |
| 300 | |
| 301 | deps = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 302 | ":AppRTCMobile_ios_bundle_data", |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 303 | ":AppRTCMobile_lib", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 304 | ] |
| 305 | |
| 306 | if (target_cpu == "x86") { |
| 307 | deps += [ "//testing/iossim:iossim" ] |
| 308 | } |
| 309 | } |
| 310 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 311 | bundle_data("AppRTCMobile_ios_bundle_data") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 312 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 313 | "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf", |
| 314 | "objc/AppRTCMobile/ios/resources/iPhone5@2x.png", |
| 315 | "objc/AppRTCMobile/ios/resources/iPhone6@2x.png", |
| 316 | "objc/AppRTCMobile/ios/resources/iPhone6p@3x.png", |
| 317 | "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png", |
| 318 | "objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png", |
| 319 | "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png", |
| 320 | "objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png", |
denicija | 6d6762c | 2016-10-28 04:53:16 -0700 | [diff] [blame] | 321 | "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp.png", |
| 322 | "objc/AppRTCMobile/ios/resources/ic_settings_black_24dp@2x.png", |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 323 | "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png", |
| 324 | "objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png", |
| 325 | "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png", |
| 326 | "objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png", |
| 327 | "objc/AppRTCMobile/ios/resources/mozart.mp3", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 328 | "objc/Icon.png", |
| 329 | ] |
| 330 | outputs = [ |
| 331 | "{{bundle_resources_dir}}/{{source_file_part}}", |
| 332 | ] |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | if (is_mac) { |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 337 | rtc_static_library("AppRTCMobile_lib") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 338 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 339 | "objc/AppRTCMobile/mac/APPRTCAppDelegate.h", |
| 340 | "objc/AppRTCMobile/mac/APPRTCAppDelegate.m", |
| 341 | "objc/AppRTCMobile/mac/APPRTCViewController.h", |
| 342 | "objc/AppRTCMobile/mac/APPRTCViewController.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 343 | ] |
| 344 | configs += [ |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 345 | "..:common_objc", |
| 346 | "//build/config/compiler:enable_arc", |
| 347 | ] |
| 348 | deps = [ |
| 349 | ":apprtc_common", |
| 350 | ":apprtc_signaling", |
| 351 | ] |
| 352 | } |
| 353 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 354 | mac_app_bundle("AppRTCMobile") { |
| 355 | output_name = "AppRTCMobile" |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 356 | |
| 357 | extra_substitutions = [ "MACOSX_DEPLOYMENT_TARGET=10.8" ] |
| 358 | |
| 359 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 360 | "objc/AppRTCMobile/mac/main.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 361 | ] |
| 362 | |
| 363 | public_configs = [ "..:common_inherited_config" ] |
| 364 | |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 365 | info_plist = "objc/AppRTCMobile/mac/Info.plist" |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 366 | |
| 367 | libs = [ "AppKit.framework" ] |
| 368 | |
| 369 | deps = [ |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 370 | ":AppRTCMobile_lib", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 371 | ] |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | config("socketrocket_include_config") { |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 376 | include_dirs = [ "objc/AppRTCMobile/third_party/SocketRocket" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | config("socketrocket_warning_config") { |
| 380 | # GN orders flags on a target before flags from configs. The default config |
| 381 | # adds these flags so to cancel them out they need to come from a config and |
| 382 | # cannot be on the target directly. |
| 383 | cflags = [ |
| 384 | "-Wno-deprecated-declarations", |
| 385 | "-Wno-nonnull", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 386 | "-Wno-semicolon-before-method-body", |
| 387 | "-Wno-unused-variable", |
| 388 | ] |
| 389 | |
henrika | 27d8b61 | 2016-09-21 04:13:00 -0700 | [diff] [blame] | 390 | cflags_objc = [ |
| 391 | # Enabled for cflags_objc in build/config/compiler/BUILD.gn. |
| 392 | "-Wno-objc-missing-property-synthesis", |
| 393 | |
| 394 | # Hide the warning for SecRandomCopyBytes(), until we update to upstream. |
| 395 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396 |
| 396 | "-Wno-unused-result", |
| 397 | ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 398 | |
| 399 | if (is_mac) { |
| 400 | cflags += [ "-Wno-partial-availability" ] |
| 401 | } |
| 402 | } |
| 403 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 404 | rtc_static_library("socketrocket") { |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 405 | sources = [ |
Magnus Jedvert | c1815cf | 2016-09-27 10:10:41 +0200 | [diff] [blame] | 406 | "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h", |
| 407 | "objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m", |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 408 | ] |
| 409 | configs += [ |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 410 | "//build/config/compiler:enable_arc", |
| 411 | ":socketrocket_warning_config", |
| 412 | ] |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 413 | public_configs = [ ":socketrocket_include_config" ] |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 414 | |
| 415 | libs = [ |
| 416 | "CFNetwork.framework", |
| 417 | "icucore", |
| 418 | ] |
| 419 | } |
adam.fedor | bcc5d87 | 2016-11-07 14:53:28 -0800 | [diff] [blame] | 420 | |
| 421 | if (rtc_include_tests) { |
| 422 | config("rtc_apprtcmobile_config") { |
| 423 | defines = [ "GTEST_RELATIVE_PATH" ] |
| 424 | } |
| 425 | |
| 426 | rtc_test("apprtcmobile_tests") { |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 427 | include_dirs = [ "objc/AppRTCMobile/ios" ] |
adam.fedor | bcc5d87 | 2016-11-07 14:53:28 -0800 | [diff] [blame] | 428 | deps = [ |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 429 | ":AppRTCMobile_lib", |
adam.fedor | bcc5d87 | 2016-11-07 14:53:28 -0800 | [diff] [blame] | 430 | ":apprtc_signaling", |
| 431 | "//testing/gtest", |
| 432 | "//third_party/ocmock", |
| 433 | ] |
| 434 | |
| 435 | sources = [ |
| 436 | "objc/AppRTCMobile/tests/ARDAppClientTest.mm", |
denicija | 77bfd7c | 2016-11-15 00:41:26 -0800 | [diff] [blame] | 437 | "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm", |
adam.fedor | bcc5d87 | 2016-11-07 14:53:28 -0800 | [diff] [blame] | 438 | ] |
| 439 | |
| 440 | if (is_ios) { |
| 441 | info_plist = "objc/AppRTCMobile/ios/Info.plist" |
| 442 | } |
| 443 | |
| 444 | configs += [ |
| 445 | ":rtc_apprtcmobile_config", |
| 446 | "//build/config/compiler:enable_arc", |
| 447 | ] |
| 448 | } |
| 449 | } |
tkchin | 2ddfdba | 2016-08-07 21:37:45 -0700 | [diff] [blame] | 450 | } |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 451 | |
| 452 | if (is_linux || is_win) { |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 453 | config("peerconnection_client_warnings_config") { |
kjellander | 4a9abad | 2016-09-18 08:12:29 -0700 | [diff] [blame] | 454 | cflags = [] |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 455 | if (is_win && is_clang) { |
kjellander | 4a9abad | 2016-09-18 08:12:29 -0700 | [diff] [blame] | 456 | cflags += [ |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 457 | # Disable warnings failing when compiling with Clang on Windows. |
| 458 | # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366 |
| 459 | "-Wno-format", |
| 460 | |
| 461 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6271 |
| 462 | # for -Wno-reorder and -Wno-sign-compare |
| 463 | "-Wno-reorder", |
| 464 | "-Wno-sign-compare", |
| 465 | ] |
| 466 | } |
kjellander | d4626e5 | 2016-09-07 02:33:01 -0700 | [diff] [blame] | 467 | if (is_linux && target_cpu == "x86") { |
kjellander | 4a9abad | 2016-09-18 08:12:29 -0700 | [diff] [blame] | 468 | cflags += [ |
kjellander | d4626e5 | 2016-09-07 02:33:01 -0700 | [diff] [blame] | 469 | # Needed to compile on Linux 32-bit. |
| 470 | "-Wno-sentinel", |
| 471 | ] |
| 472 | } |
kjellander | 4a9abad | 2016-09-18 08:12:29 -0700 | [diff] [blame] | 473 | |
| 474 | if (is_clang) { |
| 475 | # TODO(ehmaldonado): Make peerconnection_client compile with the standard |
| 476 | # set of warnings. |
| 477 | # See https://bugs.chromium.org/p/webrtc/issues/detail?id=6306 |
| 478 | cflags += [ "-Wno-inconsistent-missing-override" ] |
| 479 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 480 | } |
| 481 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 482 | rtc_executable("peerconnection_client") { |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 483 | sources = [ |
| 484 | "peerconnection/client/conductor.cc", |
| 485 | "peerconnection/client/conductor.h", |
| 486 | "peerconnection/client/defaults.cc", |
| 487 | "peerconnection/client/defaults.h", |
| 488 | "peerconnection/client/peer_connection_client.cc", |
| 489 | "peerconnection/client/peer_connection_client.h", |
| 490 | ] |
ehmaldonado | 7a2ce0b | 2016-09-05 01:35:44 -0700 | [diff] [blame] | 491 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 492 | if (!build_with_chromium && is_clang) { |
| 493 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 494 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 495 | } |
| 496 | if (is_win) { |
| 497 | sources += [ |
| 498 | "peerconnection/client/flagdefs.h", |
| 499 | "peerconnection/client/main.cc", |
| 500 | "peerconnection/client/main_wnd.cc", |
| 501 | "peerconnection/client/main_wnd.h", |
| 502 | ] |
| 503 | cflags = [ "/wd4245" ] |
| 504 | configs += [ "//build/config/win:windowed" ] |
| 505 | } |
thomasanderson | ef16e99 | 2016-12-13 02:57:43 -0800 | [diff] [blame] | 506 | deps = [ |
| 507 | "//third_party/libyuv", |
| 508 | "//webrtc/api:libjingle_peerconnection", |
| 509 | "//webrtc/system_wrappers:field_trial_default", |
| 510 | "//webrtc/system_wrappers:metrics_default", |
| 511 | ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 512 | if (is_linux) { |
| 513 | sources += [ |
| 514 | "peerconnection/client/linux/main.cc", |
| 515 | "peerconnection/client/linux/main_wnd.cc", |
| 516 | "peerconnection/client/linux/main_wnd.h", |
| 517 | ] |
| 518 | libs = [ |
| 519 | "X11", |
| 520 | "Xcomposite", |
| 521 | "Xext", |
| 522 | "Xrender", |
| 523 | ] |
thomasanderson | ef16e99 | 2016-12-13 02:57:43 -0800 | [diff] [blame] | 524 | deps += [ "//build/config/linux/gtk" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 525 | } |
ehmaldonado | d02fe4b | 2016-08-26 13:31:24 -0700 | [diff] [blame] | 526 | configs += [ ":peerconnection_client_warnings_config" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 527 | if (rtc_build_json) { |
| 528 | deps += [ "//third_party/jsoncpp" ] |
| 529 | } |
| 530 | } |
kjellander | d4626e5 | 2016-09-07 02:33:01 -0700 | [diff] [blame] | 531 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 532 | rtc_executable("peerconnection_server") { |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 533 | sources = [ |
| 534 | "peerconnection/server/data_socket.cc", |
| 535 | "peerconnection/server/data_socket.h", |
| 536 | "peerconnection/server/main.cc", |
| 537 | "peerconnection/server/peer_channel.cc", |
| 538 | "peerconnection/server/peer_channel.h", |
| 539 | "peerconnection/server/utils.cc", |
| 540 | "peerconnection/server/utils.h", |
| 541 | ] |
| 542 | deps = [ |
| 543 | "//webrtc:webrtc_common", |
| 544 | "//webrtc/base:rtc_base_approved", |
| 545 | "//webrtc/tools:command_line_parser", |
| 546 | ] |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 547 | if (!build_with_chromium && is_clang) { |
| 548 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 549 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 550 | } |
| 551 | } |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 552 | rtc_executable("relayserver") { |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 553 | sources = [ |
| 554 | "relayserver/relayserver_main.cc", |
| 555 | ] |
| 556 | deps = [ |
| 557 | "//webrtc/base:rtc_base_approved", |
| 558 | "//webrtc/pc:rtc_pc", |
| 559 | "//webrtc/system_wrappers:field_trial_default", |
| 560 | "//webrtc/system_wrappers:metrics_default", |
| 561 | ] |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 562 | if (!build_with_chromium && is_clang) { |
| 563 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 564 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 565 | } |
| 566 | } |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 567 | rtc_executable("turnserver") { |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 568 | sources = [ |
| 569 | "turnserver/turnserver_main.cc", |
| 570 | ] |
| 571 | deps = [ |
| 572 | "//webrtc/base:rtc_base_approved", |
| 573 | "//webrtc/pc:rtc_pc", |
| 574 | "//webrtc/system_wrappers:field_trial_default", |
| 575 | "//webrtc/system_wrappers:metrics_default", |
| 576 | ] |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 577 | if (!build_with_chromium && is_clang) { |
| 578 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 579 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 580 | } |
| 581 | } |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 582 | rtc_executable("stunserver") { |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 583 | sources = [ |
| 584 | "stunserver/stunserver_main.cc", |
| 585 | ] |
| 586 | deps = [ |
| 587 | "//webrtc/base:rtc_base_approved", |
| 588 | "//webrtc/pc:rtc_pc", |
| 589 | "//webrtc/system_wrappers:field_trial_default", |
| 590 | "//webrtc/system_wrappers:metrics_default", |
| 591 | ] |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 592 | if (!build_with_chromium && is_clang) { |
| 593 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 594 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kthelgason | 0727f15 | 2016-08-08 09:03:23 -0700 | [diff] [blame] | 595 | } |
| 596 | } |
| 597 | } |
charujain | aca3a24 | 2016-11-01 03:09:15 -0700 | [diff] [blame] | 598 | |
| 599 | if (!build_with_chromium) { |
| 600 | # Doesn't build within Chrome on Win. |
| 601 | rtc_executable("stun_prober") { |
| 602 | sources = [ |
| 603 | "stunprober/main.cc", |
| 604 | ] |
| 605 | |
| 606 | if (!build_with_chromium && is_clang) { |
| 607 | # Suppress warnings from Chrome's Clang plugins. |
| 608 | # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
| 609 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 610 | } |
| 611 | |
| 612 | deps = [ |
| 613 | "../p2p:libstunprober", |
| 614 | "../p2p:rtc_p2p", |
| 615 | "../system_wrappers:field_trial_default", |
| 616 | ] |
| 617 | } |
| 618 | } |