Enable LTO for Android build (#21243)

### Description
Enable LTO for Android build, which can reduce binary size by 6%.
This commit is contained in:
Changming Sun 2024-07-10 18:44:17 -07:00 committed by GitHub
parent 28af544278
commit fe6ef404b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@
"android_min_sdk_version": 21,
"android_target_sdk_version": 24,
"build_params": [
"--enable_lto",
"--android",
"--parallel",
"--cmake_generator=Ninja",

View file

@ -8,6 +8,7 @@
"android_min_sdk_version": 21,
"android_target_sdk_version": 24,
"build_params": [
"--enable_lto",
"--android",
"--parallel",
"--cmake_generator=Ninja",

View file

@ -85,6 +85,7 @@ stages:
- script: |
python3 tools/ci_build/build.py \
--enable_lto \
--android \
--build_dir build \
--android_sdk_path $ANDROID_HOME \
@ -169,6 +170,7 @@ stages:
- script: |
python3 tools/ci_build/build.py \
--enable_lto \
--android \
--build_dir build_nnapi \
--android_sdk_path $ANDROID_HOME \
@ -264,6 +266,7 @@ stages:
- script: |
python3 tools/ci_build/build.py \
--enable_lto \
--android \
--build_dir build \
--android_sdk_path $ANDROID_HOME \
@ -329,6 +332,7 @@ stages:
- script: |
python3 tools/ci_build/build.py \
--enable_lto \
--android \
--build_dir build_nnapi \
--android_sdk_path $ANDROID_HOME \
@ -401,6 +405,7 @@ stages:
- script: |
python3 tools/ci_build/build.py \
--enable_lto \
--android \
--build_dir build_nnapi \
--android_sdk_path $ANDROID_HOME \

View file

@ -3,6 +3,7 @@
"os": "android",
"arch": "arm64-v8a",
"build_params": [
"--enable_lto",
"--android",
"--android_sdk_path=/android_home",
"--android_ndk_path=/ndk_home",

View file

@ -3,6 +3,7 @@
"os": "android",
"arch": "arm64-v8a",
"build_params": [
"--enable_lto",
"--android",
"--android_sdk_path=/android_home",
"--android_ndk_path=/ndk_home",