Files
Alessandro Di Federico 143c315196 Merge revng-c into revng
2024-11-21 10:50:55 +01:00

34 lines
615 B
Bash
Executable File

#!/bin/bash
#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
set -euo pipefail
DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
SHARE="$DIR/../../share/revng"
if ! test -d "$SHARE"; then
SHARE="$DIR/../share/revng"
fi
if ! test -d "$SHARE"; then
echo "Cannot find share/revng" > /dev/stderr
exit 1
fi
if grep "revng error: unexpected use of global variable" "$1"; then
exit 1
fi
clang \
-c \
-fsyntax-only \
-ferror-limit=0 \
--config "$SHARE/compile-flags.cfg" \
-I "$SHARE/include" \
-o /dev/null \
"$@"