Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions common/wrappers/cross-cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ARGS=("$@")
i=0
while [ $i -lt ${#ARGS[@]} ]; do
arg="${ARGS[$i]}"
if [ "$incpath" ]; then
if [ -n "$incpath" ]; then
if [ "$arg" = "/usr/include" ]; then
echo "[cc-wrapper] ignoring -I $arg"
echo "[cc-wrapper] ignoring ${incpath} $arg"
else
MYARGS+=("-I${arg}")
MYARGS+=("${incpath}${arg}")
fi
unset incpath
elif [ "$libpath" ]; then
Expand All @@ -23,13 +23,13 @@ while [ $i -lt ${#ARGS[@]} ]; do
MYARGS+=("-L${arg}")
fi
unset libpath
elif [ "$arg" = "-I" ]; then
incpath=1
elif [ "$arg" = "-I" -o "$arg" = "-isystem" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes all -isystem to -I, which changes the search order that might be used for headers.

incpath="$arg"
elif [ "$arg" = "-L" ]; then
libpath=1
elif [ "$arg" = "-I/usr/include" -o "$arg" = "-L/usr/lib" \
elif [ "$arg" = "-I/usr/include" -o "$arg" = "-isystem/usr/include" \
-o "$arg" = "-L/usr/lib32" -o "$arg" = "-L/usr/lib64" \
-o "$arg" = "-L/lib" ]; then
-o "$arg" = "-L/usr/lib" -o "$arg" = "-L/lib" ]; then
echo "[cc-wrapper] ignoring $arg"
else
MYARGS+=("${arg}")
Expand Down