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