toolchain: Add option to only build glslang
authorCody Northrop <cnorthrop@google.com>
Mon, 30 Nov 2015 20:40:50 +0000 (13:40 -0700)
committerJon Ashburn <jon@lunarg.com>
Tue, 1 Dec 2015 22:19:53 +0000 (15:19 -0700)
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

index e763f63..4c093f8 100755 (executable)
@@ -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