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