Commit 20eb9be5 by Tim Van Patten Committed by Commit Bot

Generate Android.bp from multiple gn descriptions

With the introduction of ABI-specific build targets (zlib), the script generate_android_bp.py needs to be updated to consume ABI-specific gn descriptions and generate ABI-specific build rules for each target. The roll_aosp.sh script was updated to generate ABI-specific gn descriptions for each: arm arm64 x86 x64 Bug: b/160727922 Test: Manual script execution and building in AOSP Change-Id: I459b388176f8fcc010f9f5668535d941b931cdd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2285272 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 80d7725d
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
# #
# Generates a roll CL within the ANGLE repository of AOSP. # Generates a roll CL within the ANGLE repository of AOSP.
GN_OUTPUT_DIRECTORY=out/Android
deps=( deps=(
"third_party/spirv-tools/src" "third_party/spirv-tools/src"
"third_party/glslang/src" "third_party/glslang/src"
...@@ -35,18 +37,23 @@ done ...@@ -35,18 +37,23 @@ done
python scripts/bootstrap.py python scripts/bootstrap.py
gclient sync -D gclient sync -D
# generate gn build files and convert them to blueprints abis=(
gn_args=( "arm"
"arm64"
"x86"
"x64"
)
rm -r ${GN_OUTPUT_DIRECTORY}
for abi in ${abis[@]}; do
# generate gn build files and convert them to blueprints
gn_args=(
"target_os = \"android\"" "target_os = \"android\""
"is_component_build = false" "is_component_build = false"
"is_debug = false" "is_debug = false"
# Build for 64-bit CPUs # Build for 64-bit CPUs
"target_cpu = \"arm64\"" "target_cpu = \"$abi\""
# Don't make a dependency on .git/HEAD. Some Android builds are done without .git folders
# present.
"angle_enable_commit_id = false"
# Target ndk API 26 to make sure ANGLE can use the Vulkan backend on Android # Target ndk API 26 to make sure ANGLE can use the Vulkan backend on Android
"android32_ndk_api_level = 26" "android32_ndk_api_level = 26"
...@@ -67,11 +74,19 @@ gn_args=( ...@@ -67,11 +74,19 @@ gn_args=(
"angle_enable_essl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 "angle_enable_essl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444
"angle_enable_glsl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 "angle_enable_glsl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444
"angle_enable_hlsl = false" "angle_enable_hlsl = false"
) )
gn gen out/Android --args="${gn_args[*]}"
gn desc out/Android --format=json "*" > out/Android/desc.json gn gen ${GN_OUTPUT_DIRECTORY} --args="${gn_args[*]}"
python scripts/generate_android_bp.py out/Android/desc.json > Android.bp gn desc ${GN_OUTPUT_DIRECTORY} --format=json "*" > ${GN_OUTPUT_DIRECTORY}/desc.$abi.json
rm -r out done
python scripts/generate_android_bp.py \
${GN_OUTPUT_DIRECTORY}/desc.arm.json \
${GN_OUTPUT_DIRECTORY}/desc.arm64.json \
${GN_OUTPUT_DIRECTORY}/desc.x86.json \
${GN_OUTPUT_DIRECTORY}/desc.x64.json > Android.bp
rm -r ${GN_OUTPUT_DIRECTORY}
git add Android.bp git add Android.bp
# Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp # Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment