mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 1 | # Copyright (c) 2014 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. |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 8 | import("//build/config/arm.gni") |
| 9 | import("//build/config/features.gni") |
| 10 | import("//build/config/mips.gni") |
| 11 | import("//build/config/sanitizers/sanitizers.gni") |
ehmaldonado | 0d729b3 | 2017-02-10 01:38:23 -0800 | [diff] [blame] | 12 | import("//build/config/ui.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 13 | import("//build_overrides/build.gni") |
mbonadei | 9660627 | 2017-03-03 19:41:59 -0800 | [diff] [blame] | 14 | |
| 15 | if (!build_with_chromium && is_component_build) { |
| 16 | print("The Gn argument `is_component_build` is currently " + |
| 17 | "ignored for WebRTC builds.") |
| 18 | print("Component builds are supported by Chromium and the argument " + |
| 19 | "`is_component_build` makes it possible to create shared libraries " + |
| 20 | "instead of static libraries.") |
| 21 | print("If an app depends on WebRTC it makes sense to just depend on the " + |
| 22 | "WebRTC static library, so there is no difference between " + |
| 23 | "`is_component_build=true` and `is_component_build=false`.") |
| 24 | print( |
| 25 | "More info about component builds at: " + "https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md") |
| 26 | assert(!is_component_build, "Component builds are not supported in WebRTC.") |
| 27 | } |
| 28 | |
kthelgason | 4065a57 | 2017-02-14 04:58:56 -0800 | [diff] [blame] | 29 | if (is_ios) { |
| 30 | import("//build/config/ios/rules.gni") |
| 31 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 32 | |
Anders Carlsson | 37bbf79 | 2018-09-05 16:29:27 +0200 | [diff] [blame] | 33 | if (is_mac) { |
| 34 | import("//build/config/mac/rules.gni") |
| 35 | } |
| 36 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 37 | declare_args() { |
Mirko Bonadei | 7040090 | 2018-08-21 15:44:28 +0200 | [diff] [blame] | 38 | # WARNING: This argument doesn't have any effect on the WebRTC build until |
| 39 | # https://webrtc-review.googlesource.com/c/src/+/94766 will land. |
Mirko Bonadei | 31b0b45 | 2018-08-22 10:37:11 +0200 | [diff] [blame] | 40 | # Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which |
Mirko Bonadei | 7040090 | 2018-08-21 15:44:28 +0200 | [diff] [blame] | 41 | # will tell the pre-processor to remove the default definition of symbols |
| 42 | # needed to use field_trial. In that case a new implementation needs to be |
| 43 | # provided. |
Mirko Bonadei | 31b0b45 | 2018-08-22 10:37:11 +0200 | [diff] [blame] | 44 | if (build_with_chromium) { |
| 45 | # When WebRTC is built as part of Chromium it should exclude the default |
| 46 | # implementation of field_trial unless it is building for NACL or |
| 47 | # Chromecast. |
| 48 | rtc_exclude_field_trial_default = !is_nacl && !is_chromecast |
| 49 | } else { |
| 50 | rtc_exclude_field_trial_default = false |
| 51 | } |
Mirko Bonadei | 7040090 | 2018-08-21 15:44:28 +0200 | [diff] [blame] | 52 | |
Mirko Bonadei | 906add4 | 2018-09-05 16:03:16 +0200 | [diff] [blame] | 53 | # WARNING: This argument doesn't have any effect on the WebRTC build until |
| 54 | # https://webrtc-review.googlesource.com/c/src/+/95480 will land. |
| 55 | # Setting this to true will define WEBRTC_EXCLUDE_METRICS_DEFAULT which |
| 56 | # will tell the pre-processor to remove the default definition of symbols |
| 57 | # needed to use metrics. In that case a new implementation needs to be |
| 58 | # provided. |
| 59 | rtc_exclude_metrics_default = build_with_chromium |
| 60 | |
Benjamin Wright | d6f86e8 | 2018-05-08 13:12:25 -0700 | [diff] [blame] | 61 | # Setting this to false will require the API user to pass in their own |
| 62 | # SSLCertificateVerifier to verify the certificates presented from a |
| 63 | # TLS-TURN server. In return disabling this saves around 100kb in the binary. |
| 64 | rtc_builtin_ssl_root_certificates = true |
| 65 | |
Karl Wiberg | eb254b4 | 2017-11-01 15:08:12 +0100 | [diff] [blame] | 66 | # Include the iLBC audio codec? |
| 67 | rtc_include_ilbc = true |
| 68 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 69 | # Disable this to avoid building the Opus audio codec. |
| 70 | rtc_include_opus = true |
| 71 | |
minyue | 2e03c66 | 2017-02-01 17:31:11 -0800 | [diff] [blame] | 72 | # Enable this if the Opus version upon which WebRTC is built supports direct |
| 73 | # encoding of 120 ms packets. |
minyue-webrtc | 516711c | 2017-07-27 17:45:49 +0200 | [diff] [blame] | 74 | rtc_opus_support_120ms_ptime = true |
minyue | 2e03c66 | 2017-02-01 17:31:11 -0800 | [diff] [blame] | 75 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 76 | # Enable this to let the Opus audio codec change complexity on the fly. |
| 77 | rtc_opus_variable_complexity = false |
| 78 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 79 | # Used to specify an external Jsoncpp include path when not compiling the |
| 80 | # library that comes with WebRTC (i.e. rtc_build_json == 0). |
| 81 | rtc_jsoncpp_root = "//third_party/jsoncpp/source/include" |
| 82 | |
| 83 | # Used to specify an external OpenSSL include path when not compiling the |
| 84 | # library that comes with WebRTC (i.e. rtc_build_ssl == 0). |
| 85 | rtc_ssl_root = "" |
| 86 | |
| 87 | # Selects fixed-point code where possible. |
| 88 | rtc_prefer_fixed_point = false |
| 89 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 90 | # Enable when an external authentication mechanism is used for performing |
| 91 | # packet authentication for RTP packets instead of libsrtp. |
| 92 | rtc_enable_external_auth = build_with_chromium |
| 93 | |
| 94 | # Selects whether debug dumps for the audio processing module |
| 95 | # should be generated. |
| 96 | apm_debug_dump = false |
| 97 | |
| 98 | # Set this to true to enable BWE test logging. |
| 99 | rtc_enable_bwe_test_logging = false |
| 100 | |
Joachim Bauch | 93e9134 | 2017-12-07 01:25:53 +0100 | [diff] [blame] | 101 | # Set this to false to skip building examples. |
| 102 | rtc_build_examples = true |
| 103 | |
| 104 | # Set this to false to skip building tools. |
| 105 | rtc_build_tools = true |
| 106 | |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 107 | # Set this to false to skip building code that requires X11. |
| 108 | rtc_use_x11 = use_x11 |
| 109 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 110 | # Enable to use the Mozilla internal settings. |
| 111 | build_with_mozilla = false |
| 112 | |
henrika | 883d00f | 2018-03-16 10:09:49 +0100 | [diff] [blame] | 113 | # Enable use of Android AAudio which requires Android SDK 26 or above and |
| 114 | # NDK r16 or above. |
| 115 | rtc_enable_android_aaudio = false |
| 116 | |
| 117 | # TODO(henrika): can this flag be removed? |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 118 | rtc_enable_android_opensl = false |
| 119 | |
| 120 | # Link-Time Optimizations. |
| 121 | # Executes code generation at link-time instead of compile-time. |
| 122 | # https://gcc.gnu.org/wiki/LinkTimeOptimization |
| 123 | rtc_use_lto = false |
| 124 | |
| 125 | # Set to "func", "block", "edge" for coverage generation. |
| 126 | # At unit test runtime set UBSAN_OPTIONS="coverage=1". |
| 127 | # It is recommend to set include_examples=0. |
| 128 | # Use llvm's sancov -html-report for human readable reports. |
| 129 | # See http://clang.llvm.org/docs/SanitizerCoverage.html . |
| 130 | rtc_sanitize_coverage = "" |
| 131 | |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 132 | # Links a default implementation of task queues to targets |
| 133 | # that depend on the target rtc_task_queue. Set to false to |
| 134 | # use an external implementation. |
| 135 | rtc_link_task_queue_impl = true |
| 136 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 137 | if (current_cpu == "arm" || current_cpu == "arm64") { |
| 138 | rtc_prefer_fixed_point = true |
| 139 | } |
| 140 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 141 | # Determines whether NEON code will be built. |
| 142 | rtc_build_with_neon = |
| 143 | (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64" |
| 144 | |
| 145 | # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on |
| 146 | # all platforms except Android and iOS. Because FFmpeg can be built |
| 147 | # with/without H.264 support, |ffmpeg_branding| has to separately be set to a |
| 148 | # value that includes H.264, for example "Chrome". If FFmpeg is built without |
Sergey Silkin | fe288eb | 2018-06-25 16:22:38 +0200 | [diff] [blame] | 149 | # H.264, compilation succeeds but |H264DecoderImpl| fails to initialize. |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 150 | # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. |
| 151 | # http://www.openh264.org, https://www.ffmpeg.org/ |
Patrik Höglund | 3bb1194 | 2018-03-16 12:36:26 +0000 | [diff] [blame] | 152 | rtc_use_h264 = proprietary_codecs && !is_android && !is_ios |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 153 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 154 | # By default, use normal platform audio support or dummy audio, but don't |
| 155 | # use file-based audio playout and record. |
| 156 | rtc_use_dummy_audio_file_devices = false |
| 157 | |
henrika | 7be7883 | 2017-06-13 17:34:16 +0200 | [diff] [blame] | 158 | # When set to true, replace the audio output with a sinus tone at 440Hz. |
| 159 | # The ADM will ask for audio data from WebRTC but instead of reading real |
| 160 | # audio samples from NetEQ, a sinus tone will be generated and replace the |
| 161 | # real audio samples. |
| 162 | rtc_audio_device_plays_sinus_tone = false |
| 163 | |
Anders Carlsson | dd8c165 | 2018-01-30 10:32:13 +0100 | [diff] [blame] | 164 | # Disable this to build without support for built-in software codecs. |
| 165 | rtc_use_builtin_sw_codecs = true |
Anders Carlsson | 358f2e0 | 2018-06-04 10:24:37 +0200 | [diff] [blame] | 166 | |
| 167 | if (is_ios) { |
| 168 | # Build broadcast extension in AppRTCMobile for iOS. This results in the |
| 169 | # binary only running on iOS 11+, which is why it is disabled by default. |
| 170 | rtc_apprtcmobile_broadcast_extension = false |
| 171 | } |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 172 | |
| 173 | # Determines whether Metal is available on iOS/macOS. |
| 174 | rtc_use_metal_rendering = is_mac || (is_ios && current_cpu == "arm64") |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 175 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 176 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 177 | if (!build_with_mozilla) { |
| 178 | import("//testing/test.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | # A second declare_args block, so that declarations within it can |
| 182 | # depend on the possibly overridden variables in the first |
| 183 | # declare_args block. |
| 184 | declare_args() { |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 185 | # Enables the use of protocol buffers for debug recordings. |
| 186 | rtc_enable_protobuf = !build_with_mozilla |
| 187 | |
| 188 | # Set this to disable building with support for SCTP data channels. |
| 189 | rtc_enable_sctp = !build_with_mozilla |
| 190 | |
| 191 | # Disable these to not build components which can be externally provided. |
| 192 | rtc_build_json = !build_with_mozilla |
| 193 | rtc_build_libsrtp = !build_with_mozilla |
| 194 | rtc_build_libvpx = !build_with_mozilla |
| 195 | rtc_libvpx_build_vp9 = !build_with_mozilla |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 196 | rtc_build_opus = !build_with_mozilla |
| 197 | rtc_build_ssl = !build_with_mozilla |
| 198 | rtc_build_usrsctp = !build_with_mozilla |
| 199 | |
| 200 | # Enable libevent task queues on platforms that support it. |
| 201 | # rtc_link_task_queue_impl must be set to true for this to |
| 202 | # have an effect. |
Wez | 00cecb9 | 2018-02-09 10:41:00 -0800 | [diff] [blame] | 203 | if (is_win || is_mac || is_ios || is_nacl || is_fuchsia) { |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 204 | rtc_enable_libevent = false |
| 205 | rtc_build_libevent = false |
| 206 | } else { |
| 207 | rtc_enable_libevent = true |
| 208 | rtc_build_libevent = !build_with_mozilla |
| 209 | } |
| 210 | |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 211 | # Build sources requiring GTK. NOTICE: This is not present in Chrome OS |
| 212 | # build environments, even if available for Chromium builds. |
| 213 | rtc_use_gtk = !build_with_chromium && !build_with_mozilla |
| 214 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 215 | # Excluded in Chromium since its prerequisites don't require Pulse Audio. |
| 216 | rtc_include_pulse_audio = !build_with_chromium |
| 217 | |
| 218 | # Chromium uses its own IO handling, so the internal ADM is only built for |
| 219 | # standalone WebRTC. |
| 220 | rtc_include_internal_audio_device = !build_with_chromium |
| 221 | |
| 222 | # Include tests in standalone checkout. |
Dan Minor | 9c68613 | 2018-01-15 10:20:00 -0500 | [diff] [blame] | 223 | rtc_include_tests = !build_with_chromium && !build_with_mozilla |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | # Make it possible to provide custom locations for some libraries (move these |
| 227 | # up into declare_args should we need to actually use them for the GN build). |
| 228 | rtc_libvpx_dir = "//third_party/libvpx" |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 229 | rtc_opus_dir = "//third_party/opus" |
| 230 | |
| 231 | # Desktop capturer is supported only on Windows, OSX and Linux. |
Joachim Bauch | 75f18fc | 2017-12-20 21:25:47 +0100 | [diff] [blame] | 232 | rtc_desktop_capture_supported = is_win || is_mac || (is_linux && rtc_use_x11) |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 233 | |
| 234 | ############################################################################### |
| 235 | # Templates |
| 236 | # |
| 237 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 238 | # Points to // in webrtc stand-alone or to //third_party/webrtc/ in |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 239 | # chromium. |
| 240 | # We need absolute paths for all configs in templates as they are shared in |
| 241 | # different subdirectories. |
| 242 | webrtc_root = get_path_info(".", "abspath") |
| 243 | |
| 244 | # Global configuration that should be applied to all WebRTC targets. |
| 245 | # You normally shouldn't need to include this in your target as it's |
| 246 | # automatically included when using the rtc_* templates. |
| 247 | # It sets defines, include paths and compilation warnings accordingly, |
| 248 | # both for WebRTC stand-alone builds and for the scenario when WebRTC |
| 249 | # native code is built as part of Chromium. |
Will Harris | fc173d0 | 2018-08-29 13:56:00 -0700 | [diff] [blame] | 250 | rtc_common_configs = [ |
| 251 | webrtc_root + ":common_config", |
| 252 | "//build/config/compiler:no_size_t_to_int_warning", |
| 253 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 254 | |
kthelgason | c097710 | 2017-04-24 00:57:16 -0700 | [diff] [blame] | 255 | if (is_mac || is_ios) { |
| 256 | rtc_common_configs += [ "//build/config/compiler:enable_arc" ] |
| 257 | } |
| 258 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 259 | # Global public configuration that should be applied to all WebRTC targets. You |
| 260 | # normally shouldn't need to include this in your target as it's automatically |
| 261 | # included when using the rtc_* templates. It set the defines, include paths and |
| 262 | # compilation warnings that should be propagated to dependents of the targets |
| 263 | # depending on the target having this config. |
| 264 | rtc_common_inherited_config = webrtc_root + ":common_inherited_config" |
| 265 | |
| 266 | # Common configs to remove or add in all rtc targets. |
| 267 | rtc_remove_configs = [] |
| 268 | rtc_add_configs = rtc_common_configs |
Mirko Bonadei | 96ede16 | 2018-09-06 13:45:44 +0200 | [diff] [blame^] | 269 | rtc_prod_configs = [ webrtc_root + ":rtc_prod_config" ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 270 | |
| 271 | set_defaults("rtc_test") { |
| 272 | configs = rtc_add_configs |
| 273 | suppressed_configs = [] |
| 274 | } |
| 275 | |
| 276 | set_defaults("rtc_source_set") { |
| 277 | configs = rtc_add_configs |
| 278 | suppressed_configs = [] |
| 279 | } |
| 280 | |
| 281 | set_defaults("rtc_executable") { |
| 282 | configs = rtc_add_configs |
| 283 | suppressed_configs = [] |
| 284 | } |
| 285 | |
| 286 | set_defaults("rtc_static_library") { |
| 287 | configs = rtc_add_configs |
| 288 | suppressed_configs = [] |
| 289 | } |
| 290 | |
| 291 | set_defaults("rtc_shared_library") { |
| 292 | configs = rtc_add_configs |
| 293 | suppressed_configs = [] |
| 294 | } |
| 295 | |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 296 | webrtc_default_visibility = [ webrtc_root + "/*" ] |
| 297 | if (build_with_chromium) { |
| 298 | # Allow Chromium's WebRTC overrides targets to bypass the regular |
| 299 | # visibility restrictions. |
| 300 | webrtc_default_visibility += [ webrtc_root + "/../webrtc_overrides/*" ] |
| 301 | } |
| 302 | |
Karl Wiberg | bb23c83 | 2018-04-22 19:55:00 +0200 | [diff] [blame] | 303 | # ---- Poisons ---- |
| 304 | # |
| 305 | # The general idea is that some targets declare that they contain some |
| 306 | # kind of poison, which makes it impossible for other targets to |
| 307 | # depend on them (even transitively) unless they declare themselves |
| 308 | # immune to that particular type of poison. |
| 309 | # |
| 310 | # Targets that *contain* poison of type foo should contain the line |
| 311 | # |
| 312 | # poisonous = [ "foo" ] |
| 313 | # |
| 314 | # and targets that *are immune but arent't themselves poisonous* |
| 315 | # should contain |
| 316 | # |
| 317 | # allow_poison = [ "foo" ] |
| 318 | # |
| 319 | # This useful in cases where we have some large target or set of |
| 320 | # targets and want to ensure that most other targets do not |
| 321 | # transitively depend on them. For example, almost no high-level |
| 322 | # target should depend on the audio codecs, since we want WebRTC users |
| 323 | # to be able to inject any subset of them and actually end up with a |
| 324 | # binary that doesn't include the codecs they didn't inject. |
| 325 | # |
| 326 | # Test-only targets (`testonly` set to true) and non-public targets |
| 327 | # (`visibility` not containing "*") are automatically immune to all |
| 328 | # types of poison. |
| 329 | # |
| 330 | # Here's the complete list of all types of poison. It must be kept in |
| 331 | # 1:1 correspondence with the set of //:poison_* targets. |
| 332 | # |
| 333 | all_poison_types = [ |
| 334 | # Encoders and decoders for specific audio codecs such as Opus and iSAC. |
| 335 | "audio_codecs", |
Anders Carlsson | 1f433e4 | 2018-04-24 16:39:05 +0200 | [diff] [blame] | 336 | |
| 337 | # Software video codecs (VP8 and VP9 through libvpx). |
| 338 | "software_video_codecs", |
Karl Wiberg | bb23c83 | 2018-04-22 19:55:00 +0200 | [diff] [blame] | 339 | ] |
| 340 | |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 341 | absl_include_config = "//third_party/abseil-cpp:absl_include_config" |
| 342 | absl_define_config = "//third_party/abseil-cpp:absl_define_config" |
| 343 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 344 | template("rtc_test") { |
| 345 | test(target_name) { |
| 346 | forward_variables_from(invoker, |
| 347 | "*", |
| 348 | [ |
| 349 | "configs", |
| 350 | "public_configs", |
| 351 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 352 | "visibility", |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 353 | ]) |
Mirko Bonadei | dd41194 | 2017-11-21 15:35:27 +0100 | [diff] [blame] | 354 | |
| 355 | # Always override to public because when target_os is Android the `test` |
| 356 | # template can override it to [ "*" ] and we want to avoid conditional |
| 357 | # visibility. |
Mirko Bonadei | 2155881 | 2017-11-21 12:47:34 +0100 | [diff] [blame] | 358 | visibility = [ "*" ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 359 | configs += invoker.configs |
| 360 | configs -= rtc_remove_configs |
| 361 | configs -= invoker.suppressed_configs |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 362 | public_configs = [ |
| 363 | rtc_common_inherited_config, |
| 364 | absl_include_config, |
| 365 | absl_define_config, |
| 366 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 367 | if (defined(invoker.public_configs)) { |
| 368 | public_configs += invoker.public_configs |
| 369 | } |
sakal | d7fdb80 | 2017-05-26 01:51:53 -0700 | [diff] [blame] | 370 | if (!build_with_chromium && is_android) { |
Jianjun Zhu | 037f3e4 | 2017-08-15 21:48:37 +0800 | [diff] [blame] | 371 | android_manifest = webrtc_root + "test/android/AndroidManifest.xml" |
| 372 | deps += [ webrtc_root + "test:native_test_java" ] |
sakal | d7fdb80 | 2017-05-26 01:51:53 -0700 | [diff] [blame] | 373 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 374 | } |
| 375 | } |
| 376 | |
| 377 | template("rtc_source_set") { |
| 378 | source_set(target_name) { |
| 379 | forward_variables_from(invoker, |
| 380 | "*", |
| 381 | [ |
| 382 | "configs", |
| 383 | "public_configs", |
| 384 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 385 | "visibility", |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 386 | ]) |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 387 | forward_variables_from(invoker, [ "visibility" ]) |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 388 | if (!defined(visibility)) { |
| 389 | visibility = webrtc_default_visibility |
| 390 | } |
Karl Wiberg | bb23c83 | 2018-04-22 19:55:00 +0200 | [diff] [blame] | 391 | |
| 392 | # What's your poison? |
| 393 | if (defined(testonly) && testonly) { |
| 394 | assert(!defined(poisonous)) |
| 395 | assert(!defined(allow_poison)) |
| 396 | } else { |
| 397 | if (!defined(poisonous)) { |
| 398 | poisonous = [] |
| 399 | } |
| 400 | if (!defined(allow_poison)) { |
| 401 | allow_poison = [] |
| 402 | } |
| 403 | if (!defined(assert_no_deps)) { |
| 404 | assert_no_deps = [] |
| 405 | } |
| 406 | if (!defined(deps)) { |
| 407 | deps = [] |
| 408 | } |
| 409 | foreach(p, poisonous) { |
| 410 | deps += [ webrtc_root + ":poison_" + p ] |
| 411 | } |
| 412 | foreach(poison_type, all_poison_types) { |
| 413 | allow_dep = true |
| 414 | foreach(v, visibility) { |
| 415 | if (v == "*") { |
| 416 | allow_dep = false |
| 417 | } |
| 418 | } |
| 419 | foreach(p, allow_poison + poisonous) { |
| 420 | if (p == poison_type) { |
| 421 | allow_dep = true |
| 422 | } |
| 423 | } |
| 424 | if (!allow_dep) { |
| 425 | assert_no_deps += [ webrtc_root + ":poison_" + poison_type ] |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | |
Mirko Bonadei | 96ede16 | 2018-09-06 13:45:44 +0200 | [diff] [blame^] | 430 | if (!defined(testonly) || !testonly) { |
| 431 | configs += rtc_prod_configs |
| 432 | } |
| 433 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 434 | configs += invoker.configs |
| 435 | configs -= rtc_remove_configs |
| 436 | configs -= invoker.suppressed_configs |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 437 | public_configs = [ |
| 438 | rtc_common_inherited_config, |
| 439 | absl_include_config, |
| 440 | absl_define_config, |
| 441 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 442 | if (defined(invoker.public_configs)) { |
| 443 | public_configs += invoker.public_configs |
| 444 | } |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | template("rtc_executable") { |
| 449 | executable(target_name) { |
| 450 | forward_variables_from(invoker, |
| 451 | "*", |
| 452 | [ |
| 453 | "deps", |
| 454 | "configs", |
| 455 | "public_configs", |
| 456 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 457 | "visibility", |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 458 | ]) |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 459 | forward_variables_from(invoker, [ "visibility" ]) |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 460 | if (!defined(visibility)) { |
| 461 | visibility = webrtc_default_visibility |
| 462 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 463 | configs += invoker.configs |
| 464 | configs -= rtc_remove_configs |
| 465 | configs -= invoker.suppressed_configs |
Tom Anderson | 9614a31 | 2018-06-11 15:10:34 -0700 | [diff] [blame] | 466 | deps = invoker.deps |
perkj | 650fdae | 2017-08-25 05:00:11 -0700 | [diff] [blame] | 467 | |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 468 | public_configs = [ |
| 469 | rtc_common_inherited_config, |
| 470 | absl_include_config, |
| 471 | absl_define_config, |
| 472 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 473 | if (defined(invoker.public_configs)) { |
| 474 | public_configs += invoker.public_configs |
| 475 | } |
Mirko Bonadei | 9427f48 | 2018-08-28 14:39:27 +0200 | [diff] [blame] | 476 | if (is_win) { |
| 477 | deps += [ |
| 478 | # Give executables the default manifest on Windows (a no-op elsewhere). |
| 479 | "//build/win:default_exe_manifest", |
| 480 | ] |
| 481 | } |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 482 | } |
| 483 | } |
| 484 | |
| 485 | template("rtc_static_library") { |
| 486 | static_library(target_name) { |
| 487 | forward_variables_from(invoker, |
| 488 | "*", |
| 489 | [ |
| 490 | "configs", |
| 491 | "public_configs", |
| 492 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 493 | "visibility", |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 494 | ]) |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 495 | forward_variables_from(invoker, [ "visibility" ]) |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 496 | if (!defined(visibility)) { |
| 497 | visibility = webrtc_default_visibility |
| 498 | } |
Karl Wiberg | bb23c83 | 2018-04-22 19:55:00 +0200 | [diff] [blame] | 499 | |
| 500 | # What's your poison? |
| 501 | if (defined(testonly) && testonly) { |
| 502 | assert(!defined(poisonous)) |
| 503 | assert(!defined(allow_poison)) |
| 504 | } else { |
| 505 | if (!defined(poisonous)) { |
| 506 | poisonous = [] |
| 507 | } |
| 508 | if (!defined(allow_poison)) { |
| 509 | allow_poison = [] |
| 510 | } |
| 511 | if (!defined(assert_no_deps)) { |
| 512 | assert_no_deps = [] |
| 513 | } |
| 514 | if (!defined(deps)) { |
| 515 | deps = [] |
| 516 | } |
| 517 | foreach(p, poisonous) { |
| 518 | deps += [ webrtc_root + ":poison_" + p ] |
| 519 | } |
| 520 | foreach(poison_type, all_poison_types) { |
| 521 | allow_dep = true |
| 522 | foreach(v, visibility) { |
| 523 | if (v == "*") { |
| 524 | allow_dep = false |
| 525 | } |
| 526 | } |
| 527 | foreach(p, allow_poison + poisonous) { |
| 528 | if (p == poison_type) { |
| 529 | allow_dep = true |
| 530 | } |
| 531 | } |
| 532 | if (!allow_dep) { |
| 533 | assert_no_deps += [ webrtc_root + ":poison_" + poison_type ] |
| 534 | } |
| 535 | } |
| 536 | } |
| 537 | |
Mirko Bonadei | 96ede16 | 2018-09-06 13:45:44 +0200 | [diff] [blame^] | 538 | if (!defined(testonly) || !testonly) { |
| 539 | configs += rtc_prod_configs |
| 540 | } |
| 541 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 542 | configs += invoker.configs |
| 543 | configs -= rtc_remove_configs |
| 544 | configs -= invoker.suppressed_configs |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 545 | public_configs = [ |
| 546 | rtc_common_inherited_config, |
| 547 | absl_include_config, |
| 548 | absl_define_config, |
| 549 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 550 | if (defined(invoker.public_configs)) { |
| 551 | public_configs += invoker.public_configs |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | template("rtc_shared_library") { |
| 557 | shared_library(target_name) { |
| 558 | forward_variables_from(invoker, |
| 559 | "*", |
| 560 | [ |
| 561 | "configs", |
| 562 | "public_configs", |
| 563 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 564 | "visibility", |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 565 | ]) |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 566 | forward_variables_from(invoker, [ "visibility" ]) |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 567 | if (!defined(visibility)) { |
| 568 | visibility = webrtc_default_visibility |
| 569 | } |
Karl Wiberg | bb23c83 | 2018-04-22 19:55:00 +0200 | [diff] [blame] | 570 | |
| 571 | # What's your poison? |
| 572 | if (defined(testonly) && testonly) { |
| 573 | assert(!defined(poisonous)) |
| 574 | assert(!defined(allow_poison)) |
| 575 | } else { |
| 576 | if (!defined(poisonous)) { |
| 577 | poisonous = [] |
| 578 | } |
| 579 | if (!defined(allow_poison)) { |
| 580 | allow_poison = [] |
| 581 | } |
| 582 | if (!defined(assert_no_deps)) { |
| 583 | assert_no_deps = [] |
| 584 | } |
| 585 | if (!defined(deps)) { |
| 586 | deps = [] |
| 587 | } |
| 588 | foreach(p, poisonous) { |
| 589 | deps += [ webrtc_root + ":poison_" + p ] |
| 590 | } |
| 591 | foreach(poison_type, all_poison_types) { |
| 592 | allow_dep = true |
| 593 | foreach(v, visibility) { |
| 594 | if (v == "*") { |
| 595 | allow_dep = false |
| 596 | } |
| 597 | } |
| 598 | foreach(p, allow_poison + poisonous) { |
| 599 | if (p == poison_type) { |
| 600 | allow_dep = true |
| 601 | } |
| 602 | } |
| 603 | if (!allow_dep) { |
| 604 | assert_no_deps += [ webrtc_root + ":poison_" + poison_type ] |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 609 | configs += invoker.configs |
| 610 | configs -= rtc_remove_configs |
| 611 | configs -= invoker.suppressed_configs |
Mirko Bonadei | 9a89a49 | 2018-05-29 14:22:32 +0000 | [diff] [blame] | 612 | public_configs = [ |
| 613 | rtc_common_inherited_config, |
| 614 | absl_include_config, |
| 615 | absl_define_config, |
| 616 | ] |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 617 | if (defined(invoker.public_configs)) { |
| 618 | public_configs += invoker.public_configs |
| 619 | } |
| 620 | } |
| 621 | } |
kthelgason | 4065a57 | 2017-02-14 04:58:56 -0800 | [diff] [blame] | 622 | |
| 623 | if (is_ios) { |
| 624 | set_defaults("rtc_ios_xctest_test") { |
| 625 | configs = rtc_add_configs |
| 626 | suppressed_configs = [] |
| 627 | } |
| 628 | |
| 629 | template("rtc_ios_xctest_test") { |
| 630 | ios_xctest_test(target_name) { |
| 631 | forward_variables_from(invoker, |
| 632 | "*", |
| 633 | [ |
| 634 | "configs", |
| 635 | "public_configs", |
| 636 | "suppressed_configs", |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 637 | "visibility", |
kthelgason | 4065a57 | 2017-02-14 04:58:56 -0800 | [diff] [blame] | 638 | ]) |
Karl Wiberg | 138d4ac | 2017-10-16 11:16:19 +0200 | [diff] [blame] | 639 | forward_variables_from(invoker, [ "visibility" ]) |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 640 | if (!defined(visibility)) { |
| 641 | visibility = webrtc_default_visibility |
| 642 | } |
kthelgason | 4065a57 | 2017-02-14 04:58:56 -0800 | [diff] [blame] | 643 | configs += invoker.configs |
| 644 | configs -= rtc_remove_configs |
| 645 | configs -= invoker.suppressed_configs |
| 646 | public_configs = [ rtc_common_inherited_config ] |
| 647 | if (defined(invoker.public_configs)) { |
| 648 | public_configs += invoker.public_configs |
| 649 | } |
| 650 | } |
| 651 | } |
Anders Carlsson | dc6b477 | 2018-01-15 13:31:03 +0100 | [diff] [blame] | 652 | |
| 653 | template("ios_framework_bundle_with_umbrella_header") { |
| 654 | forward_variables_from(invoker, [ "output_name" ]) |
| 655 | umbrella_header_path = |
| 656 | "$target_gen_dir/$output_name.framework/Headers/$output_name.h" |
| 657 | |
| 658 | ios_framework_bundle(target_name) { |
| 659 | forward_variables_from(invoker, "*", []) |
| 660 | |
| 661 | deps += [ ":copy_umbrella_header_$target_name" ] |
| 662 | } |
| 663 | |
| 664 | action("umbrella_header_$target_name") { |
| 665 | forward_variables_from(invoker, [ "public_headers" ]) |
| 666 | |
| 667 | script = "//tools_webrtc/ios/generate_umbrella_header.py" |
| 668 | |
| 669 | outputs = [ |
| 670 | umbrella_header_path, |
| 671 | ] |
| 672 | args = [ |
| 673 | "--out", |
| 674 | rebase_path(umbrella_header_path, root_build_dir), |
| 675 | "--sources", |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 676 | ] + public_headers |
Anders Carlsson | dc6b477 | 2018-01-15 13:31:03 +0100 | [diff] [blame] | 677 | } |
| 678 | |
| 679 | copy("copy_umbrella_header_$target_name") { |
| 680 | sources = [ |
| 681 | umbrella_header_path, |
| 682 | ] |
| 683 | outputs = [ |
| 684 | "$root_out_dir/$output_name.framework/Headers/$output_name.h", |
| 685 | ] |
| 686 | |
| 687 | deps = [ |
| 688 | ":umbrella_header_$target_name", |
| 689 | ] |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | set_defaults("ios_framework_bundle_with_umbrella_header") { |
| 694 | configs = default_shared_library_configs |
| 695 | } |
kthelgason | 4065a57 | 2017-02-14 04:58:56 -0800 | [diff] [blame] | 696 | } |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 697 | |
Anders Carlsson | 37bbf79 | 2018-09-05 16:29:27 +0200 | [diff] [blame] | 698 | if (is_mac) { |
| 699 | template("mac_framework_bundle_with_umbrella_header") { |
| 700 | forward_variables_from(invoker, [ "output_name" ]) |
| 701 | umbrella_header_path = |
| 702 | "$target_gen_dir/$output_name.framework/Headers/$output_name.h" |
| 703 | |
| 704 | mac_framework_bundle(target_name) { |
| 705 | forward_variables_from(invoker, "*", []) |
| 706 | |
| 707 | framework_version = "A" |
| 708 | framework_contents = [ "Headers" ] |
| 709 | |
| 710 | ldflags = [ |
| 711 | "-all_load", |
| 712 | "-install_name", |
| 713 | "@rpath/$output_name.framework/$output_name", |
| 714 | ] |
| 715 | |
| 716 | deps += [ |
| 717 | ":copy_framework_headers_$target_name", |
| 718 | ":copy_umbrella_header_$target_name", |
| 719 | ] |
| 720 | } |
| 721 | |
| 722 | copy("copy_framework_headers_$target_name") { |
| 723 | forward_variables_from(invoker, [ "sources" ]) |
| 724 | |
| 725 | outputs = [ |
| 726 | "$root_out_dir/$output_name.framework/Headers/{{source_file_part}}", |
| 727 | ] |
| 728 | } |
| 729 | |
| 730 | action("umbrella_header_$target_name") { |
| 731 | forward_variables_from(invoker, [ "sources" ]) |
| 732 | |
| 733 | script = "//tools_webrtc/ios/generate_umbrella_header.py" |
| 734 | |
| 735 | outputs = [ |
| 736 | umbrella_header_path, |
| 737 | ] |
| 738 | args = [ |
| 739 | "--out", |
| 740 | rebase_path(umbrella_header_path, root_build_dir), |
| 741 | "--sources", |
| 742 | ] + sources |
| 743 | } |
| 744 | |
| 745 | copy("copy_umbrella_header_$target_name") { |
| 746 | sources = [ |
| 747 | umbrella_header_path, |
| 748 | ] |
| 749 | outputs = [ |
| 750 | "$root_out_dir/$output_name.framework/Headers/$output_name.h", |
| 751 | ] |
| 752 | |
| 753 | deps = [ |
| 754 | ":umbrella_header_$target_name", |
| 755 | ] |
| 756 | } |
| 757 | } |
| 758 | } |
| 759 | |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 760 | if (is_android) { |
| 761 | template("rtc_android_library") { |
| 762 | android_library(target_name) { |
| 763 | forward_variables_from(invoker, |
| 764 | "*", |
| 765 | [ |
| 766 | "configs", |
| 767 | "public_configs", |
| 768 | "suppressed_configs", |
| 769 | "visibility", |
| 770 | ]) |
| 771 | |
Sami Kalliomäki | e7fac68 | 2018-03-20 16:32:49 +0100 | [diff] [blame] | 772 | javac_args = [] |
| 773 | |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 774 | # Treat warnings as errors. |
Sami Kalliomäki | e7fac68 | 2018-03-20 16:32:49 +0100 | [diff] [blame] | 775 | javac_args += [ "-Werror" ] |
| 776 | |
Sami Kalliomäki | dc52651 | 2018-03-27 17:07:27 +0200 | [diff] [blame] | 777 | # TODO(crbug.com/824679): Find out why this fails in Chromium |
| 778 | if (!build_with_chromium) { |
| 779 | javac_args += [ |
| 780 | "-Xep:ParameterNotNullable:ERROR", |
| 781 | "-Xep:FieldMissingNullable:ERROR", |
| 782 | "-Xep:ReturnMissingNullable:ERROR", |
| 783 | ] |
| 784 | } |
| 785 | |
Sami Kalliomäki | e7fac68 | 2018-03-20 16:32:49 +0100 | [diff] [blame] | 786 | # Add any arguments defined by the invoker. |
| 787 | if (defined(invoker.javac_args)) { |
| 788 | javac_args += invoker.javac_args |
| 789 | } |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 790 | |
Sami Kalliomäki | dc52651 | 2018-03-27 17:07:27 +0200 | [diff] [blame] | 791 | if (!defined(deps)) { |
| 792 | deps = [] |
| 793 | } |
| 794 | deps += [ "//third_party/jsr-305:jsr_305_javalib" ] |
| 795 | |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 796 | no_build_hooks = true |
| 797 | } |
| 798 | } |
| 799 | |
| 800 | template("rtc_android_apk") { |
| 801 | android_apk(target_name) { |
| 802 | forward_variables_from(invoker, |
| 803 | "*", |
| 804 | [ |
| 805 | "configs", |
| 806 | "public_configs", |
| 807 | "suppressed_configs", |
| 808 | "visibility", |
| 809 | ]) |
| 810 | |
| 811 | # Treat warnings as errors. |
| 812 | javac_args = [ "-Werror" ] |
| 813 | |
Sami Kalliomäki | dc52651 | 2018-03-27 17:07:27 +0200 | [diff] [blame] | 814 | # TODO(crbug.com/824679): Find out why this fails in Chromium |
| 815 | if (!build_with_chromium) { |
| 816 | javac_args += [ |
| 817 | "-Xep:ParameterNotNullable:ERROR", |
| 818 | "-Xep:FieldMissingNullable:ERROR", |
| 819 | "-Xep:ReturnMissingNullable:ERROR", |
| 820 | ] |
| 821 | } |
| 822 | |
| 823 | if (!defined(deps)) { |
| 824 | deps = [] |
| 825 | } |
| 826 | deps += [ "//third_party/jsr-305:jsr_305_javalib" ] |
| 827 | |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 828 | no_build_hooks = true |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | template("rtc_instrumentation_test_apk") { |
| 833 | instrumentation_test_apk(target_name) { |
| 834 | forward_variables_from(invoker, |
| 835 | "*", |
| 836 | [ |
| 837 | "configs", |
| 838 | "public_configs", |
| 839 | "suppressed_configs", |
| 840 | "visibility", |
| 841 | ]) |
| 842 | |
| 843 | # Treat warnings as errors. |
| 844 | javac_args = [ "-Werror" ] |
| 845 | |
Sami Kalliomäki | dc52651 | 2018-03-27 17:07:27 +0200 | [diff] [blame] | 846 | # TODO(crbug.com/824679): Find out why this fails in Chromium |
| 847 | if (!build_with_chromium) { |
| 848 | javac_args += [ |
| 849 | "-Xep:ParameterNotNullable:ERROR", |
| 850 | "-Xep:FieldMissingNullable:ERROR", |
| 851 | "-Xep:ReturnMissingNullable:ERROR", |
| 852 | ] |
| 853 | } |
| 854 | |
| 855 | if (!defined(deps)) { |
| 856 | deps = [] |
| 857 | } |
| 858 | deps += [ "//third_party/jsr-305:jsr_305_javalib" ] |
| 859 | |
Mirko Bonadei | fbb3b7d | 2017-11-07 15:36:33 +0000 | [diff] [blame] | 860 | no_build_hooks = true |
| 861 | } |
| 862 | } |
| 863 | } |