#!/bin/bash
DIR="$(dirname "$(readlink -f "$0")")"
SRC_ROOT=$DIR/../..

compiler="gcc"
build_type="debug"
case "$1" in
        clang)
           compiler="clang"
            ;;
        release)
           build_type="release"
            ;;
        *)
            ;;
esac
build_path="$($DIR/../sparkd_path.sh build $compiler $build_type)"
BUILD_CMD="ninja -C $build_path"
touch $SRC_ROOT/CMakeLists.txt
$DIR/execute_in_docker $BUILD_CMD
