33 lines
542 B
Bash
Executable File

#!/bin/bash
BUILD_TYPE="debug"
KERNEL="$(uname -s)"
ARGS=""
while [[ $# > 0 ]];do
case $1 in
--release)
BUILD_TYPE="release"
shift
;;
*|-*|--*)
rest=("$@")
ARGS+=" ${rest[0]}"
shift
;;
esac
done
if [[ $KERNEL == "Darwin" ]]; then
if [[ ! -d .venv ]]; then
python3 -m venv .venv
fi
source .venv/bin/activate
pip install scan-build
intercept-build make CC=intercept-cc CXX=intercept-c++ BUILD_TYPE=$BUILD_TYPE $ARGS
deactivate
else
bear -- make BUILD_TYPE=$BUILD_TYPE $ARGS
fi