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