diff --git a/ohos_build/build.sh b/ohos_build/build.sh index 3aa632144dd911970e322912f82ea9027a04e327..fd26f1d6c4d54bcab62bb4abb0497bb922a34216 100755 --- a/ohos_build/build.sh +++ b/ohos_build/build.sh @@ -69,6 +69,7 @@ artifact_mode=0 with_nweb_ex=0 build_sysroot="use_ohos_sdk_sysroot=false" build_asan=0 +use_thin_lto=0 usage() { echo -ne "USAGE: $0 [OPTIONS] [PRODUCT] @@ -143,6 +144,9 @@ while [ "$1" != "" ]; do "-asan") build_asan=1 ;; + "-nolto") + use_thin_lto=1 + ;; "-ex") with_nweb_ex=1 ;; @@ -221,6 +225,10 @@ else GN_ARGS="${GN_ARGS} is_asan=false" fi +if [ ${use_thin_lto} -eq 1 ]; then + GN_ARGS="${GN_ARGS} use_thin_lto=false" +fi + # Extract ohos-sdk. if [ -f "src/ohos_sdk/.install" ]; then bash "src/ohos_sdk/.install"