From 93778de874c0f66ce3d9d8563d297bcaa4725825 Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Mon, 30 Nov 2015 13:40:50 -0700 Subject: [PATCH] toolchain: Add option to only build glslang New usage: update_external_sources.sh -g or: update_external_sources.sh --glslang-only Building LunarGLASS by default takes a long time on systems that don't need it. --- update_external_sources.sh | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/update_external_sources.sh b/update_external_sources.sh index e763f63..4c093f8 100755 --- a/update_external_sources.sh +++ b/update_external_sources.sh @@ -94,15 +94,41 @@ function build_LunarGLASS () { make install } +# Parse options +while [[ $# > 0 ]] +do +option="$1" + +case $option in + # option to allow just building glslang components + -g|--glslang-only) + GLSLANG_ONLY=true + echo "Building glslang only: GLSLANG_ONLY=true" + ;; + *) + echo "Unrecognized option: $option" + exit 1 + ;; +esac +shift +done + if [ ! -d "$BASEDIR/glslang" -o ! -d "$BASEDIR/glslang/.git" -o -d "$BASEDIR/glslang/.svn" ]; then create_glslang fi -if [ ! -d "$BASEDIR/LunarGLASS" -o ! -d "$BASEDIR/LunarGLASS/.git" ]; then - create_LunarGLASS + +if [ ! $GLSLANG_ONLY ]; then + if [ ! -d "$BASEDIR/LunarGLASS" -o ! -d "$BASEDIR/LunarGLASS/.git" ]; then + create_LunarGLASS + fi fi update_glslang -update_LunarGLASS +if [ ! $GLSLANG_ONLY ]; then + update_LunarGLASS +fi build_glslang -build_LunarGLASS +if [ ! $GLSLANG_ONLY ]; then + build_LunarGLASS +fi -- 2.7.4