Created
April 9, 2021 16:48
-
-
Save LigH-de/30dcb3d8434b29752041107482c77f55 to your computer and use it in GitHub Desktop.
x265 multilib build script for x86-64 Windows EXE in media-autobuild suite's MSYS2/MinGW64 mintty shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p /build/x265_git-git/build/msys64_hdr10_ml | |
export CXXFLAGS= | |
cd /build/x265_git-git/build/msys64_hdr10_ml/ | |
mkdir -p 8bit 10bit 12bit | |
cd 12bit | |
make --no-print-directory clean-generated | |
cmake -G "MSYS Makefiles" ../../../source -DHG_EXECUTABLE=/usr/bin/hg.bat -DCMAKE_CXX_COMPILER=/local64/bin/g++.bat -DCMAKE_TOOLCHAIN_FILE=/local64/etc/toolchain.cmake -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DMAIN12=ON -DENABLE_HDR10_PLUS=ON -DENABLE_LIBVMAF=ON | |
make --no-print-directory ${MAKEFLAGS} | |
cp libx265.a ../8bit/libx265_main12.a | |
cd ../10bit | |
make --no-print-directory clean-generated | |
cmake -G "MSYS Makefiles" ../../../source -DHG_EXECUTABLE=/usr/bin/hg.bat -DCMAKE_CXX_COMPILER=/local64/bin/g++.bat -DCMAKE_TOOLCHAIN_FILE=/local64/etc/toolchain.cmake -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DMAIN12=OFF -DENABLE_HDR10_PLUS=ON -DENABLE_LIBVMAF=ON | |
make --no-print-directory ${MAKEFLAGS} | |
cp libx265.a ../8bit/libx265_main10.a | |
cd ../8bit | |
make --no-print-directory clean-generated | |
cmake -G "MSYS Makefiles" ../../../source -DHG_EXECUTABLE=/usr/bin/hg.bat -DCMAKE_CXX_COMPILER=/local64/bin/g++.bat -DCMAKE_TOOLCHAIN_FILE=/local64/etc/toolchain.cmake -DEXPORT_C_API=ON -DENABLE_SHARED=ON -DENABLE_CLI=ON -DHIGH_BIT_DEPTH=OFF -DENABLE_HDR10_PLUS=ON -DENABLE_LIBVMAF=ON -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON | |
make --no-print-directory ${MAKEFLAGS} | |
# rename the 8bit library, then combine all three into libx265.a using GNU ar | |
mv libx265.a libx265_main.a | |
ar -M <<EOF | |
CREATE libx265.a | |
ADDLIB libx265_main.a | |
ADDLIB libx265_main10.a | |
ADDLIB libx265_main12.a | |
SAVE | |
END | |
EOF | |
/mingw64/bin/strip.exe --strip-unneeded libx265.dll | |
/mingw64/bin/strip.exe --strip-unneeded x265.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment