Integrated of building VVC into batch files

Both shell scripts of Linux and macOS were now merged into one for detect OS with simple command
For Windows build script of Visual Studio is merged into VVCEasy.bat (batch file script).

Both files of Windows batch file & Unix shell script were able to build Fraunhofer VVC binaries.

- Martin Eesmaa
This commit is contained in:
MartinEesmaa
2024-09-08 16:16:54 +10:00
parent 14e9dbee6d
commit d31979f8f5
6 changed files with 143 additions and 133 deletions

90
BuildVVC.sh Normal file
View File

@@ -0,0 +1,90 @@
#!/bin/bash
OS=$(uname)
echo "Martin Eesmaa / VVC Compiler (vvenc and vvdec)"
echo "You're running on $OS of bash script version to compile VVC binaries"
setup_linux() {
echo "Checking and installing required packages..."
sudo apt update && sudo apt upgrade -y
sudo apt install build-essential cmake -y
}
setup_macos() {
echo "Please make sure Xcode is installed in your Applications."
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Please install Homebrew and rerun the script."
exit 1
fi
if ! brew list | grep -q cmake; then
echo "Installing cmake..."
brew install cmake
fi
}
setup_msys64() {
echo "Checking and installing required packages..."
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel cmake git
}
setup_freebsd() {
echo "Checking and installing required packages..."
pkg update && pkg upgrade -y
pkg install -y cmake git gmake
}
build_repos() {
echo "Cloning repositories..."
cd ~/Downloads
if [ ! -d vvenc ]; then
git clone --depth=1 https://github.com/fraunhoferhhi/vvenc
else
git pull -C vvenc
fi
if [ ! -d vvdec ]; then
git clone --depth=1 https://github.com/fraunhoferhhi/vvdec
else
git pull -C vvdec
fi
for REPO in vvenc vvdec; do
cd $REPO
mkdir build && cd build
if [ "$OS" = "Darwin" ]; then
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j $(sysctl -n hw.ncpu)
else
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static" ..
cmake --build . -j $(nproc)
fi
cd ../../
done
echo "Please see the build files starting with (vvenc/vvdec)/bin/release-static."
}
# Main script execution
case "$OS" in
Linux)
setup_linux
;;
Darwin)
setup_macos
;;
MSYS_NT*|MINGW64*)
setup_msys64
;;
FreeBSD)
setup_freebsd
;;
*)
echo "Unsupported OS: $OS"
echo "Supports Windows MSYS64, macOS, Linux & FreeBSD"
echo "May coming soon for some platforms..."
exit 1
;;
esac
build_repos
read -p "Finished building vvenc & vvdec. Press [Enter] to continue..."