Skip to content

Commit d3eb7e4

Browse files
committed
Libx265 integration improvement
1 parent 87a07be commit d3eb7e4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

scripts/libx265/build.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@ rm -rf ${CMAKE_BUILD_DIR}
66
mkdir ${CMAKE_BUILD_DIR}
77
cd ${CMAKE_BUILD_DIR}
88

9+
EXTRA_CMAKE_ARG=""
10+
case $ANDROID_ABI in
11+
arm64-v8a|x86)
12+
# Disabling assembler optimizations for certain ABIs. Not a good solution, but it at least works
13+
EXTRA_CMAKE_ARG="-DENABLE_ASSEMBLY=OFF"
14+
;;
15+
esac
16+
917
${CMAKE_EXECUTABLE} ../source \
1018
-DANDROID_PLATFORM=${ANDROID_PLATFORM} \
1119
-DANDROID_ABI=${ANDROID_ABI} \
1220
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
1321
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
14-
-DANDROID_ARM_NEON=1 \
15-
-DCONFIG_PIC=1 \
16-
-DCONFIG_RUNTIME_CPU_DETECT=0 \
17-
-DENABLE_TESTS=0 \
18-
-DENABLE_DOCS=0 \
19-
-DENABLE_TESTDATA=0 \
20-
-DENABLE_EXAMPLES=0 \
21-
-DENABLE_TOOLS=0
22+
-DENABLE_PIC=ON \
23+
$EXTRA_CMAKE_ARG
2224

23-
# TODO Make it prettier
25+
EXTRA_SED_ARG=""
2426
if [[ "$OSTYPE" == "darwin"* ]]; then
25-
sed -i '' 's/-lpthread/-pthread/' CMakeFiles/cli.dir/link.txt
26-
sed -i '' 's/-lpthread/-pthread/' CMakeFiles/x265-shared.dir/link.txt
27-
sed -i '' 's/-lpthread/-pthread/' CMakeFiles/x265-static.dir/link.txt
28-
else
29-
sed -i 's/-lpthread/-pthread/' CMakeFiles/cli.dir/link.txt
30-
sed -i 's/-lpthread/-pthread/' CMakeFiles/x265-shared.dir/link.txt
31-
sed -i 's/-lpthread/-pthread/' CMakeFiles/x265-static.dir/link.txt
27+
EXTRA_SED_ARG="''"
3228
fi
29+
sed -i $EXTRA_SED_ARG 's/-lpthread/-pthread/' CMakeFiles/cli.dir/link.txt
30+
sed -i $EXTRA_SED_ARG 's/-lpthread/-pthread/' CMakeFiles/x265-shared.dir/link.txt
31+
sed -i $EXTRA_SED_ARG 's/-lpthread/-pthread/' CMakeFiles/x265-static.dir/link.txt
3332

33+
export FFMPEG_EXTRA_LD_FLAGS="${FFMPEG_EXTRA_LD_FLAGS} -lm -lc++"
3434

3535
${MAKE_EXECUTABLE} -j${HOST_NPROC}
3636
${MAKE_EXECUTABLE} install

0 commit comments

Comments
 (0)