Skip to content

Commit

Permalink
cross-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v committed May 23, 2022
1 parent a1117c5 commit 652e210
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
18 changes: 14 additions & 4 deletions app/deps/src/build-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cd "build-$HOST"

params=(
--prefix="$INSTALL_DIR"
--arch="$ARCH"
--disable-autodetect
--disable-programs
--disable-everything
Expand All @@ -44,10 +45,19 @@ params=(
--enable-muxer=mp4
--enable-muxer=matroska
)
if [[ "$HOST_SYSTEM" == 'linux' ]]
then
params+=(--enable-libv4l2)
fi

case "$HOST_SYSTEM" in
linux)
params+=(--enable-libv4l2)
;;
windows)
params+=(--target-os=mingw32)
params+=(--cross-prefix="$HOST-")
;;
*)
fail "Unsupported platform: $HOST"
;;
esac

../configure "${params[@]}"
make -j $NJOBS
Expand Down
14 changes: 13 additions & 1 deletion app/deps/src/init_deps
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ fail() {
}

[[ -z "$HOST" ]] && fail '$HOST not defined'
[[ -z "$HOST_SYSTEM" ]] && fail '$HOST_SYSTEM not defined'

if [[ "$HOST" == *linux* ]]
then
HOST_SYSTEM='linux'
elif [[ "$HOST" == *mingw* ]]
then
HOST_SYSTEM='windows'
else
fail "Host system could not be deduced from '$HOST'"
fi

ARCH="${HOST%%-*}"
[[ -z "$ARCH" ]] && fail "Arch could not be deduced from '$HOST'"

DIR=$(dirname ${BASH_SOURCE[0]})
cd "$DIR"
Expand Down

0 comments on commit 652e210

Please sign in to comment.