You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
890 B

#!/bin/bash
# This is a wrapper for clang/clang++ gcc/g++
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z "$INFER_RESULTS_DIR" ]; then
echo '$INFER_RESULTS_DIR with a path to the results dir not provided.' > /dev/stderr
exit 1
fi
# invoke the right compiler looking at the final plusplus (e.g. gcc/g++ clang/clang++)
if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi
FRONTEND_COMMAND=("$SCRIPT_DIR/../clang_wrappers/clang_general_wrapper$XX" "$@")
HOST_COMPILER_COMMAND=("$SCRIPT_DIR/../clang_wrappers/clang_wrapper$XX" "$@")
if [ -n "$INFER_COMPILER_WRAPPER_IN_RECURSION" ]; then
if [ -z "$INFER_LISTENER" ]; then
"${HOST_COMPILER_COMMAND[@]}"
fi
else
export INFER_COMPILER_WRAPPER_IN_RECURSION="Y"
export FCP_RESULTS_DIR="$INFER_RESULTS_DIR";
export FCP_USE_STD_CLANG_CMD="1";
"${FRONTEND_COMMAND[@]}"
fi
exit $?