Hash :
12c0e765
Author :
Date :
2020-01-29T13:00:40
Add GN arg to extract native libs in APK Added GN bool arg "angle_extract_native_libs." When "false," which is the default, the native libs are zipped in the ANGLE apk. When true, the libs will be extracted which is useful when capturing flame graphs in order to see the ANGLE function names in your flamegraph. Bug: angleproject:4304 Change-Id: I86c91e5028688142b1137b859c800f2243c124d9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2028524 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
import("../gni/angle.gni")
vulkan_validation_layers = [ "VkLayer_khronos_validation" ]
angle_libraries = [
"libEGL",
"libGLESv1_CM",
"libGLESv2",
"libfeature_support",
]
if (enable_java_templates) {
template("angle_apk") {
manifest_target_name = "${target_name}__manifest"
manifest_path =
"${target_gen_dir}/${target_name}/android/AndroidManifest.xml"
jinja_template(manifest_target_name) {
input = "//third_party/angle/android/AndroidManifest.xml.jinja2"
output = manifest_path
variables = [
"manifest_package=${invoker.package_name}",
"extract_native_libs=${angle_extract_native_libs}",
]
}
android_assets("${invoker.package_name}_assets") {
disable_compression = true
sources = [
"src/feature_support_util/a4a_rules.json",
]
}
android_apk(target_name) {
forward_variables_from(invoker, "*")
android_manifest = manifest_path
android_manifest_dep = ":$manifest_target_name"
min_sdk_version = 26
target_sdk_version = 28
deps = [
":${invoker.package_name}_assets",
]
if (symbol_level != 0) {
deps += [ ":compressed_symbols" ]
if (android_64bit_target_cpu) {
deps += [ ":compressed_symbols($android_secondary_abi_toolchain)" ]
}
}
uncompress_shared_libraries = true
if (android_64bit_target_cpu) {
if (symbol_level == 0) {
secondary_abi_shared_libraries = []
foreach(_library, angle_libraries) {
secondary_abi_shared_libraries +=
[ "$angle_root:${_library}($android_secondary_abi_toolchain)" ]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
secondary_abi_shared_libraries += [
"$angle_root/third_party/vulkan-validation-layers:${_layer}" +
"($android_secondary_abi_toolchain)",
]
}
}
} else {
_secondary_out_dir = get_label_info(
":compressed_symbols($android_secondary_abi_toolchain)",
"root_out_dir")
secondary_abi_loadable_modules = []
foreach(_library, angle_libraries) {
secondary_abi_loadable_modules += [ "$_secondary_out_dir/lib.compressed/${_library}${angle_libs_suffix}.so" ]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
secondary_abi_loadable_modules +=
[ "${_secondary_out_dir}/lib.compressed/lib${_layer}.so" ]
}
}
}
}
if (symbol_level == 0) {
shared_libraries = []
foreach(_library, angle_libraries) {
shared_libraries += [ "$angle_root:$_library" ]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
shared_libraries +=
[ "$angle_root/third_party/vulkan-validation-layers:${_layer}" ]
}
}
} else {
loadable_modules = []
foreach(_library, angle_libraries) {
loadable_modules += [
"$root_out_dir/lib.compressed/${_library}${angle_libs_suffix}.so",
]
}
if (angle_enable_vulkan_validation_layers) {
foreach(_layer, vulkan_validation_layers) {
loadable_modules +=
[ "$root_out_dir/lib.compressed/lib${_layer}.so" ]
}
}
}
}
}
}