Skip to content

Commit

Permalink
build: fix minor issue in build system
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwg committed Apr 7, 2024
1 parent 75799df commit 1cbb98f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,12 @@ cd kantv
- download android-ndk-r26c to prebuilts/toolchain, skip this step if android-ndk-r26c is already exist

```
. build/envsetup.sh
./build/prebuild-download.sh
```

- environment setup

```
. build/envsetup.sh
```

- modify <a href="https://github.com/zhouwg/kantv/blob/master/build/envsetup.sh#L88">build/envsetup.sh</a> accordingly before launch build

Expand Down
11 changes: 11 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ function build_init()
echo -e "build project ${PROJECT_NAME} on ${BUILD_TIME} by ${BUILD_USER} for ${TEXT_RED} target ${BUILD_TARGET} with arch ${BUILD_ARCHS} in ${PROJECT_BUILD_TYPE} mode on host ${BUILD_HOST} ${TEXT_RESET}\n"

show_pwd

if [ "${BUILD_TARGET}" == "android" ]; then
check_ndk
if [ $? -ne 0 ]; then
printf "failed to check android ndk\n"
printf "pls run ./build/prebuild-download.sh firstly\n"
printf "\n\n"
exit 1
fi

fi
}


Expand Down
4 changes: 2 additions & 2 deletions build/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ function lunch()
elif [ "${project}" == "kantv-wasm" ]; then
export BUILD_TARGET=wasm
else
#default target is linux
export BUILD_TARGET=linux
#default target is android
export BUILD_TARGET=android
fi

setup_env
Expand Down
5 changes: 5 additions & 0 deletions build/prebuild-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ fi

if [ ${is_android_ndk_exist} -eq 0 ]; then
echo -e "begin downloading android ndk \n"

if [ ! -d ${PROJECT_ROOT_PATH}/prebuilts/toolchain ]; then
mkdir -p ${PROJECT_ROOT_PATH}/prebuilts/toolchain
fi

wget --no-config --quiet --show-progress -O ${PROJECT_ROOT_PATH}/prebuilts/toolchain/android-ndk-r25c-linux.zip https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
wget --no-config --quiet --show-progress -O ${PROJECT_ROOT_PATH}/prebuilts/toolchain/android-ndk-r26c-linux.zip https://dl.google.com/android/repository/android-ndk-r26c-linux.zip

Expand Down
3 changes: 3 additions & 0 deletions build/public.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,18 @@ function check_ndk()
if [ -z ${ANDROID_NDK} ]; then
echo -e "${TEXT_RED}NDK ${ANDROID_NDK} not exist, pls check...${TEXT_RESET}\n"
#exit 1
return 1;
fi

if [ ! -d ${ANDROID_NDK} ]; then
echo -e "${TEXT_RED}NDK ${ANDROID_NDK} not exist, pls check...${TEXT_RESET}\n"
#exit 1
return 1;
fi

if [ ! -f ${ANDROID_NDK}/build/cmake/android.toolchain.cmake ]; then
echo -e "${TEXT_RED}NDK ${ANDROID_NDK} not exist, pls check...${TEXT_RESET}\n"
return 1;
fi
}

Expand Down

0 comments on commit 1cbb98f

Please sign in to comment.