Skip to content

Commit 0394e6a

Browse files
committed
when compile android libs check depends bin
1 parent afa1b83 commit 0394e6a

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

do-compile/android/any.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ function do_compile() {
6666
./$LIB_NAME.sh
6767
}
6868

69+
function resolve_dep() {
70+
echo "[*] check depends bins: ${LIB_DEPENDS_BIN}"
71+
for b in ${LIB_DEPENDS_BIN}; do
72+
install_depends "$b"
73+
done
74+
echo "===================="
75+
}
76+
6977
function do_clean() {
7078

7179
if [[ -d $MR_BUILD_SOURCE ]];then
@@ -100,6 +108,7 @@ function main() {
100108
do_lipo_all "$MR_ACTIVE_ARCHS"
101109
;;
102110
'build')
111+
resolve_dep
103112
for arch in $MR_ACTIVE_ARCHS; do
104113
export _MR_ARCH=$arch
105114
source $MR_SHELL_TOOLS_DIR/export-android-build-env.sh

tools/export-android-host-env.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@
1717

1818
# https://github.com/Javernaut/ffmpeg-android-maker
1919

20+
function install_depends() {
21+
local name="$1"
22+
local r=$(brew list | grep "$name")
23+
if [[ -z $r ]]; then
24+
echo "will use brew install ${name}."
25+
brew install "$name"
26+
fi
27+
echo "[✅] ${name}: $(eval $name --version)"
28+
}
29+
2030
case "$OSTYPE" in
21-
darwin*) HOST_TAG="darwin-x86_64" ;;
31+
darwin*) HOST_TAG="darwin-x86_64"; export -f install_depends ;;
2232
linux*) HOST_TAG="linux-x86_64" ;;
2333
msys)
2434
case "$(uname -m)" in

0 commit comments

Comments
 (0)