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