llvm801/clang-gcc-wrapper.sh

24 lines
861 B
Bash
Raw Permalink Normal View History

2019-07-27 15:56:34 +00:00
#!/bin/sh
# Author: mikhailnov
# Clean flags that clang does not know to fix building QtWebEngine with clang
# _CLANG_ must be changed to /usr/bin/clang++ and then to /usr/bin/clang in another copy of this wrapper
if echo "$@" | grep -qE 'fvar-tracking-assignments|frecord-gcc-switches'
then
echo "DEBUG: clang-wrapper: arguements will be cut-out!"
echo "DEBUG: arguements were: "
echo "========================="
echo "$@"
echo "========================="
new_args="$(echo "$@" | sed -e 's/-fvar-tracking-assignments//g' -e 's/-frecord-gcc-switches//g')"
echo "DEBUG: new arguements are with and without expansion: "
echo "========================="
echo ${new_args}
echo "========================="
echo "${new_args}"
# https://stackoverflow.com/a/37141139 (??)
_CLANG_ ${new_args} || _CLANG_ "${new_args}"
else
_CLANG_ "$@"
fi