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