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