SPIRV-Cross/checkout_glslang_spirv_tools.sh
Hans-Kristian Arntzen 5d82d32e0f Roll dependencies.
2021-01-08 10:41:51 +01:00

56 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
GLSLANG_REV=3de5cfe50edecd001e6d703555284d9b10b3dd57
SPIRV_TOOLS_REV=f3ccb633dfd7c5de1f9f0a2d2e9d7a25f2478206
SPIRV_HEADERS_REV=f027d53ded7e230e008d37c8b47ede7cd308e19d
if [ -z $PROTOCOL ]; then
PROTOCOL=git
fi
echo "Using protocol \"$PROTOCOL\" for checking out repositories. If this is problematic, try PROTOCOL=https $0."
if [ -d external/glslang ]; then
echo "Updating glslang to revision $GLSLANG_REV."
cd external/glslang
git fetch origin
git checkout $GLSLANG_REV
else
echo "Cloning glslang revision $GLSLANG_REV."
mkdir -p external
cd external
git clone $PROTOCOL://github.com/KhronosGroup/glslang.git
cd glslang
git checkout $GLSLANG_REV
fi
cd ../..
if [ -d external/spirv-tools ]; then
echo "Updating SPIRV-Tools to revision $SPIRV_TOOLS_REV."
cd external/spirv-tools
git fetch origin
git checkout $SPIRV_TOOLS_REV
else
echo "Cloning SPIRV-Tools revision $SPIRV_TOOLS_REV."
mkdir -p external
cd external
git clone $PROTOCOL://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
cd spirv-tools
git checkout $SPIRV_TOOLS_REV
fi
if [ -d external/spirv-headers ]; then
cd external/spirv-headers
git pull origin master
git checkout $SPIRV_HEADERS_REV
cd ../..
else
git clone $PROTOCOL://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
cd external/spirv-headers
git checkout $SPIRV_HEADERS_REV
cd ../..
fi
cd ../..