@@ -8,10 +8,6 @@ HELP_MSG="Usage: build.sh <x86,amd64,arm,arm64> [static,shared] [gpl,lgpl] ...FF
88set -e
99source ./env.sh
1010
11- export BUILD_ARCH=${1:- $VSCMD_ARG_TGT_ARCH }
12- export BUILD_TYPE=${2:- shared}
13- export BUILD_LICENSE=${3:- gpl}
14-
1511if [ -z $BUILD_ARCH ]; then
1612 echo " $HELP_MSG " >&2
1713 exit 1
@@ -34,22 +30,32 @@ echo FF_ARGS=$FF_ARGS
3430
3531git -C zlib apply ../zlib.patch
3632git -C FFmpeg apply ../ffmpeg.patch || true
37- git -C x265_git apply ../x265_git.patch
3833
3934# --enable-libfribidi --enable-libass
4035# ./build-meson-dep.sh fribidi -Ddocs=false
4136# ./build-meson-dep.sh libass
4237
4338if [ " $BUILD_LICENSE " == " gpl" ]; then
4439
40+ git -C x265_git apply ../x265_git-${BUILD_TYPE} .patch
41+ if [ " $BUILD_TYPE " == " static" ]; then
42+ X265_ARGS=" -DSTATIC_LINK_CRT=ON"
43+ ENABLE_SHARED=OFF
44+ else
45+ X265_ARGS=" -DSTATIC_LINK_CRT=OFF"
46+ ENABLE_SHARED=ON
47+
48+ git -C x264 apply ../x264-${BUILD_TYPE} .patch
49+ fi
50+
4551 if [ " $BUILD_ARCH " == arm ]; then
4652 X265_ARGS=" $X265_ARGS -DCMAKE_SYSTEM_PROCESSOR=armv7l -DENABLE_ASSEMBLY=ON -DCROSS_COMPILE_ARM=ON"
4753 elif [ " $BUILD_ARCH " == arm64 ]; then
4854 X265_ARGS=" $X265_ARGS -DCMAKE_SYSTEM_PROCESSOR=arm64 -DENABLE_ASSEMBLY=ON -DCROSS_COMPILE_ARM64=ON"
4955 fi
5056
5157 git -C x265_git fetch --tags
52- ./build-cmake-dep.sh x265_git/source -DENABLE_SHARED=on -DENABLE_CLI=off $X265_ARGS
58+ ./build-cmake-dep.sh x265_git/source -DENABLE_SHARED=$ENABLE_SHARED -DENABLE_CLI=OFF $X265_ARGS
5359 FF_ARGS=" $FF_ARGS --enable-libx265"
5460
5561 if [[ " $BUILD_ARCH " =~ arm ]]; then
@@ -59,9 +65,6 @@ if [ "$BUILD_LICENSE" == "gpl" ]; then
5965 INSTALL_TARGET=install-lib-${BUILD_TYPE} ./build-make-dep.sh x264 --enable-${BUILD_TYPE} $X264_ARGS
6066 FF_ARGS=" $FF_ARGS --enable-libx264"
6167
62- if [ " $BUILD_TYPE " == " static" ]; then
63- X265_ARGS=" -DSTATIC_LINK_CRT=on"
64- fi
6568fi
6669
6770./build-make-dep.sh nv-codec-headers
0 commit comments