2018-12-01 02:24:11 +03:00
|
|
|
# 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")
|
2019-10-17 21:36:41 +03:00
|
|
|
import("../gni/angle.gni")
|
2018-12-01 02:24:11 +03:00
|
|
|
|
Reland "Vulkan: Use VK repos' internal BUILD.gn files"
This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6
There was a missing build dependence causing a build no-op
issue which has now been fixed in the upstream Vulkan Validation
Layer repo.
Primary workaround that need to be re-visted and fixed are:
1. Disabled validation layers on 32-bit Windows
2. Disabled validation layers on 32-bit Android
3. Disabled DebugUtils on Android, using DebugReport instead
4. Using custom VK Loader branch to avoid WDK dependence
Original change's description:
> Vulkan: Use VK repos' internal BUILD.gn files
>
> This retires custom BUILD.gn files for the Vulkan Headers, Tools,
> Validation-Layers, and Loader repos. They now have integrated BUILD.gn
> files so switched ANGLE to use those by default.
> Also Validation Layer, Loader, and Tools repos no longer uses codegen
> so this speeds up the build overall.
> Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer
> to VK_LAYER_KHRONOS_validation unified layer.
>
> This changes includes a temporary workaround to the Vulkan-Loader repo
> to remove its Window's build dependence on WDK. There are plans to
> remove that depenedence in Loader master, but until then we can use
> our custom branch workaround.
> It also includes a custom branch for validation layers that includes
> some build fixes for ANGLE.
> Finally, the layers were crashing on Android when attempting to use
> DebugUtils extension so forcing DebugReport on Android for now.
>
> Bug: angleproject:2449
> Bug: angleproject:3320
> Bug: angleproject:3852
> Bug: angleproject:3924
> Bug: angleproject:3925
> Bug: angleproject:3946
> Bug: chromium:997009
> Bug: chromium:997016
> Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Tobin Ehlis <tobine@google.com>
Bug: angleproject:2449, angleproject:3320, angleproject:3852
Change-Id: I373ada091a1329db5e304874079428d01ba21d52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778302
Reviewed-by: Tobin Ehlis <tobine@google.com>
Commit-Queue: Tobin Ehlis <tobine@google.com>
2019-07-19 00:10:49 +03:00
|
|
|
vulkan_validation_layers = [ "VkLayer_khronos_validation" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
|
|
|
|
angle_libraries = [
|
2019-06-28 18:24:27 +03:00
|
|
|
"libEGL",
|
|
|
|
"libGLESv1_CM",
|
|
|
|
"libGLESv2",
|
|
|
|
"libfeature_support",
|
2019-01-03 22:40:13 +03:00
|
|
|
]
|
|
|
|
|
2019-10-17 21:36:41 +03:00
|
|
|
if (enable_java_templates) {
|
|
|
|
template("angle_apk") {
|
|
|
|
manifest_target_name = "${target_name}__manifest"
|
|
|
|
manifest_path =
|
|
|
|
"${target_gen_dir}/${target_name}/android/AndroidManifest.xml"
|
2018-12-01 02:24:11 +03:00
|
|
|
|
2019-10-17 21:36:41 +03:00
|
|
|
jinja_template(manifest_target_name) {
|
2021-04-21 19:12:26 +03:00
|
|
|
input = "${angle_root}/android/AndroidManifest.xml.jinja2"
|
2019-10-17 21:36:41 +03:00
|
|
|
output = manifest_path
|
2020-01-29 23:00:40 +03:00
|
|
|
variables = [
|
|
|
|
"manifest_package=${invoker.package_name}",
|
|
|
|
"extract_native_libs=${angle_extract_native_libs}",
|
|
|
|
]
|
2019-10-17 21:36:41 +03:00
|
|
|
}
|
2018-12-01 02:24:11 +03:00
|
|
|
|
2019-10-17 21:36:41 +03:00
|
|
|
android_assets("${invoker.package_name}_assets") {
|
|
|
|
disable_compression = true
|
2020-02-21 20:12:51 +03:00
|
|
|
sources = [ "src/feature_support_util/a4a_rules.json" ]
|
2019-10-17 21:36:41 +03:00
|
|
|
}
|
2018-12-01 02:24:11 +03:00
|
|
|
|
2019-10-17 21:36:41 +03:00
|
|
|
android_apk(target_name) {
|
|
|
|
forward_variables_from(invoker, "*")
|
|
|
|
android_manifest = manifest_path
|
|
|
|
android_manifest_dep = ":$manifest_target_name"
|
2020-09-23 06:37:54 +03:00
|
|
|
version_code = invoker.version_code
|
|
|
|
version_name = invoker.version_name
|
2019-10-17 21:36:41 +03:00
|
|
|
min_sdk_version = 26
|
|
|
|
target_sdk_version = 28
|
2021-04-21 19:12:26 +03:00
|
|
|
generate_final_jni = false
|
2020-02-21 20:12:51 +03:00
|
|
|
deps = [ ":${invoker.package_name}_assets" ]
|
2019-10-17 21:36:41 +03:00
|
|
|
if (symbol_level != 0) {
|
|
|
|
deps += [ ":compressed_symbols" ]
|
2019-12-04 23:05:57 +03:00
|
|
|
if (android_64bit_target_cpu) {
|
2019-10-17 21:36:41 +03:00
|
|
|
deps += [ ":compressed_symbols($android_secondary_abi_toolchain)" ]
|
|
|
|
}
|
2018-12-13 03:06:47 +03:00
|
|
|
}
|
2018-12-01 02:24:11 +03:00
|
|
|
|
2019-10-17 21:36:41 +03:00
|
|
|
uncompress_shared_libraries = true
|
|
|
|
|
2019-12-04 23:05:57 +03:00
|
|
|
if (android_64bit_target_cpu) {
|
2019-10-17 21:36:41 +03:00
|
|
|
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) {
|
2020-12-16 03:25:50 +03:00
|
|
|
secondary_abi_shared_libraries +=
|
|
|
|
[ "$angle_vulkan_validation_layers_dir:${_layer}" +
|
|
|
|
"($android_secondary_abi_toolchain)" ]
|
2019-10-17 21:36:41 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_secondary_out_dir = get_label_info(
|
|
|
|
":compressed_symbols($android_secondary_abi_toolchain)",
|
|
|
|
"root_out_dir")
|
|
|
|
secondary_abi_loadable_modules = []
|
|
|
|
foreach(_library, angle_libraries) {
|
2021-04-21 19:12:26 +03:00
|
|
|
secondary_abi_loadable_modules += [ "$_secondary_out_dir/lib.compressed/${_library}${angle_libs_suffix}${shlib_extension}" ]
|
2019-10-17 21:36:41 +03:00
|
|
|
}
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
|
|
|
foreach(_layer, vulkan_validation_layers) {
|
2021-04-21 19:12:26 +03:00
|
|
|
secondary_abi_loadable_modules += [ "${_secondary_out_dir}/lib.compressed/lib${_layer}${shlib_extension}" ]
|
2019-10-17 21:36:41 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-12-01 02:24:11 +03:00
|
|
|
|
2018-12-13 03:06:47 +03:00
|
|
|
if (symbol_level == 0) {
|
2019-10-17 21:36:41 +03:00
|
|
|
shared_libraries = []
|
2019-01-03 22:40:13 +03:00
|
|
|
foreach(_library, angle_libraries) {
|
2019-10-17 21:36:41 +03:00
|
|
|
shared_libraries += [ "$angle_root:$_library" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
|
|
|
foreach(_layer, vulkan_validation_layers) {
|
2019-10-17 21:36:41 +03:00
|
|
|
shared_libraries +=
|
2020-12-16 03:25:50 +03:00
|
|
|
[ "$angle_vulkan_validation_layers_dir:${_layer}" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
}
|
2018-12-13 03:06:47 +03:00
|
|
|
} else {
|
2019-10-17 21:36:41 +03:00
|
|
|
loadable_modules = []
|
2019-01-03 22:40:13 +03:00
|
|
|
foreach(_library, angle_libraries) {
|
2021-04-21 19:12:26 +03:00
|
|
|
loadable_modules += [ "$root_out_dir/lib.compressed/${_library}${angle_libs_suffix}${shlib_extension}" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
|
|
|
foreach(_layer, vulkan_validation_layers) {
|
2021-04-21 19:12:26 +03:00
|
|
|
loadable_modules += [
|
|
|
|
"$root_out_dir/lib.compressed/lib${_layer}${shlib_extension}",
|
|
|
|
]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
}
|
2018-12-13 03:06:47 +03:00
|
|
|
}
|
2018-12-13 03:06:47 +03:00
|
|
|
}
|
2018-12-01 02:24:11 +03:00
|
|
|
}
|
|
|
|
}
|