Chromium Code Reviews| Index: components/cronet/android/BUILD.gn |
| diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn |
| index 170bb4c7f3885d6d1c56b6e34efb54a2bdee56f5..e08f2368ed63ef4318f9b1b711d5358b4188b6a2 100644 |
| --- a/components/cronet/android/BUILD.gn |
| +++ b/components/cronet/android/BUILD.gn |
| @@ -909,16 +909,46 @@ copy("cronet_package_copy_native_lib_unstripped") { |
| ] |
| } |
| +# Enforce that ARM Neon is not used when building for ARMv7 |
| +if (target_cpu == "arm" && arm_version == 7 && !arm_use_neon) { |
| + action("enforce_no_neon") { |
| + assert(!arm_use_neon) |
|
Dirk Pranke
2016/07/27 16:43:33
Given the if conditions, this assert is no longer
pauljensen
2016/08/19 11:52:05
Done.
|
| + script = "//components/cronet/tools/check_no_neon.py" |
| + args = [ |
| + rebase_path("${android_tool_prefix}objdump", root_build_dir), |
| + |
| + # libcronet.so may contain ARM Neon instructions from BoringSSL, but these |
| + # are only used after checking whether the CPU supports NEON at runtime, |
| + # so instead check base/ as it represents a large swath of code that only |
| + # contains Neon instructions when Neon is enabled by default. |
| + rebase_path("$root_out_dir/obj/base/base/*.o", root_build_dir), |
| + ] |
| + outputs = [ |
| + "$root_out_dir/cronet_$target_name.d", |
| + ] |
| + deps = [ |
| + "//base:base", |
| + ] |
| + } |
| +} |
| + |
| group("cronet_package") { |
| - deps = [ |
| - ":cronet_package_copy", |
| - ":cronet_package_copy_native_lib", |
| - ":cronet_package_copy_native_lib_unstripped", |
| - ":generate_javadoc", |
| - ":generate_licenses", |
| - ":jar_cronet_api_source", |
| - ":jar_cronet_other_source", |
| - ":jar_cronet_sample_source", |
| - ":repackage_extracted_jars", |
| - ] |
| + # Enforce that arm_use_neon==false when building for ARMv7 by |
| + # not including any deps in cronet_package target otherwise. |
| + if (!(target_cpu == "arm" && arm_version == 7) || !arm_use_neon) { |
| + deps = [ |
|
Dirk Pranke
2016/07/27 16:43:33
Don't you want these deps to be set unconditionall
pauljensen
2016/08/18 16:12:33
No, that would allow building Cronet for ARMv7 wit
Dirk Pranke
2016/08/18 17:10:38
Ah, got it.
|
| + ":cronet_package_copy", |
| + ":cronet_package_copy_native_lib", |
| + ":cronet_package_copy_native_lib_unstripped", |
| + ":generate_javadoc", |
| + ":generate_licenses", |
| + ":jar_cronet_api_source", |
| + ":jar_cronet_other_source", |
| + ":jar_cronet_sample_source", |
| + ":repackage_extracted_jars", |
| + ] |
| + if (current_cpu == "arm" && arm_version == 7) { |
| + deps += [ ":enforce_no_neon" ] |
| + } |
| + } |
| } |