feat: windows build script
parent
c92dc234b9
commit
0cfb7b5ffa
|
@ -0,0 +1,3 @@
|
|||
export OPENH264_OS=$(uname | tr A-Z a-z | tr -d \\-0-9. | sed -E 's/^(net|open|free)bsd/bsd/')
|
||||
|
||||
CC=gcc CXX=g++ AR=ar bash build.sh
|
|
@ -1,3 +1,3 @@
|
|||
TOOLCHAIN=x86_64-w64-mingw32
|
||||
|
||||
FFMPEG_OS=win64 OPENH264_ARCH=x86_64 OPENH264_OS=mingw_nt CC=$TOOLCHAIN-gcc CXX=$TOOLCHAIN-g++ AR=$TOOLCHAIN-ar bash build.sh --arch x86_64
|
||||
FFMPEG_OS=win64 FFMPEG_MSBUILD=1 OPENH264_ARCH=x86_64 OPENH264_OS=msvc CC=cl CXX=cl AR=lib bash build.sh --arch x86_64
|
||||
|
|
3
build.sh
3
build.sh
|
@ -1,5 +1,6 @@
|
|||
export ARCH=$(uname -m)
|
||||
export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count / 2 ) ) }')
|
||||
# do not use all cpus because my computer dies
|
||||
export JOBS=$(awk -v count=$(nproc) 'BEGIN { print ( int( count - 1 ) ) }')
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
|
|
|
@ -6,12 +6,18 @@ cd $ffmpegPath
|
|||
|
||||
make distclean
|
||||
|
||||
flags="--cc=$CC --cxx=$CXX"
|
||||
|
||||
if [[ -z $FFMPEG_MSVC ]]; then
|
||||
flags="--toolchain=msvc"
|
||||
fi
|
||||
|
||||
./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \
|
||||
--disable-ffprobe --disable-ffplay --enable-static --disable-shared \
|
||||
--enable-libopenh264 \
|
||||
--prefix=$PREFIX --enable-cross-compile --arch=$ARCH \
|
||||
--cc="$CC" --cxx="$CXX" \
|
||||
--pkg-config-flags="--static" --target-os=$FFMPEG_OS
|
||||
--pkg-config-flags="--static" --target-os=$FFMPEG_OS \
|
||||
${flags}
|
||||
|
||||
make -j$JOBS
|
||||
|
||||
|
|
Loading…
Reference in New Issue