Skip to content

Commit c751e7b

Browse files
committed
test
1 parent 9d7e78f commit c751e7b

File tree

7 files changed

+56
-77
lines changed

7 files changed

+56
-77
lines changed

build-cmake-dep.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ amd64)
2222
esac
2323

2424
if [ $BUILD_TYPE == "static" ]; then
25-
BUILD_SHARED_LIBS=ON
25+
BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF}
2626
CMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY:-MultiThreaded}
2727
else
28-
BUILD_SHARED_LIBS=ON
28+
BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-ON}
2929
CMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY:-MultiThreadedDLL}
3030
fi
3131
cmake "$SRC_DIR" --install-prefix "$INSTALL_PREFIX" -A=$BUILD_ARCH -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_MSVC_RUNTIME_LIBRARY=$CMAKE_MSVC_RUNTIME_LIBRARY $@

build.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ HELP_MSG="Usage: build.sh <x86,amd64,arm,arm64> [static,shared] [gpl,lgpl] ...FF
88
set -e
99
source ./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-
1511
if [ -z $BUILD_ARCH ]; then
1612
echo "$HELP_MSG" >&2
1713
exit 1
@@ -34,22 +30,32 @@ echo FF_ARGS=$FF_ARGS
3430

3531
git -C zlib apply ../zlib.patch
3632
git -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

4338
if [ "$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
6568
fi
6669

6770
./build-make-dep.sh nv-codec-headers

env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55

66
export INSTALL_PREFIX=${INSTALL_PREFIX:-/usr/local}
77
export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$INSTALL_PREFIX/share/pkgconfig
8+
9+
export BUILD_ARCH=${1:-$VSCMD_ARG_TGT_ARCH}
10+
export BUILD_TYPE=${2:-shared}
11+
export BUILD_LICENSE=${3:-gpl}
12+
813
export CC=cl
914
export CXX=cl

x264-shared.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/configure b/configure
2+
index e242e73c..a95af920 100755
3+
--- a/configure
4+
+++ b/configure
5+
@@ -1633,7 +1633,7 @@ includedir=$includedir
6+
Name: x264
7+
Description: H.264 (MPEG4 AVC) encoder library
8+
Version: $(grep POINTVER < x264_config.h | sed -e 's/.* "//; s/".*//; s/ .*//')
9+
-Libs: -L$libdir -lx264 $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl)
10+
+Libs: -L$libdir -llibx264.dll $([ "$shared" = "yes" ] || echo $libpthread $libm $libdl)
11+
Libs.private: $([ "$shared" = "yes" ] && echo $libpthread $libm $libdl)
12+
Cflags: -I$includedir $([ "$shared" = "yes" ] && echo "-DX264_API_IMPORTS")
13+
EOF

x265_git-shared.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/source/x265.pc.in b/source/x265.pc.in
2+
index 0bf99e938..7b1a0550e 100644
3+
--- a/source/x265.pc.in
4+
+++ b/source/x265.pc.in
5+
@@ -6,6 +6,6 @@ includedir=${prefix}/include
6+
Name: @CMAKE_PROJECT_NAME@
7+
Description: H.265/HEVC video encoder
8+
Version: @X265_LATEST_TAG@
9+
-Libs: -L${libdir} -lx265
10+
+Libs: -L${libdir} -llibx265
11+
Libs.private: @PRIVATE_LIBS@
12+
Cflags: -I${includedir}

x265_git-static.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/source/x265.pc.in b/source/x265.pc.in
2+
index 0bf99e938..051470536 100644
3+
--- a/source/x265.pc.in
4+
+++ b/source/x265.pc.in
5+
@@ -6,6 +6,6 @@ includedir=${prefix}/include
6+
Name: @CMAKE_PROJECT_NAME@
7+
Description: H.265/HEVC video encoder
8+
Version: @X265_LATEST_TAG@
9+
-Libs: -L${libdir} -lx265
10+
+Libs: -L${libdir} -lx265-static
11+
Libs.private: @PRIVATE_LIBS@
12+
Cflags: -I${includedir}

x265_git.patch

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)