Skip to content

Commit

Permalink
More work on issue Andersbakken#92. Make it possible to run a script …
Browse files Browse the repository at this point in the history
…for dynamic set

up of RTAGS_ARGS in gcc-rtags-wrapper.sh

To use just make a script called rtags_args. It gets called with the
same args as gcc would have been and its stdout will be added to the
args passed to rc --compile
  • Loading branch information
Andersbakken committed Mar 31, 2013
1 parent 5ef305d commit c41b0a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/gcc-rtags-wrapper.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ function followSymlink()
python -c "import os, sys; print os.path.realpath(\"$1\")"
}


rc=`which rc`
for i in `which -a "\`basename $0\`"`; do
resolved=`followSymlink $i`
if [ `basename $resolved` != "gcc-rtags-wrapper.sh" ]; then
[ -n "$RTAGS_SERVER_FILE" ] && RTAGS_ARGS="$RTAGS_ARGS -n$RTAGS_SERVER_FILE"
[ -n "$RTAGS_PROJECT" ] && RTAGS_ARGS="$RTAGS_ARGS --with-project=$RTAGS_PROJECT"
[ -z "$RTAGS_COMPILE_TIMEOUT" ] && RTAGS_COMPILE_TIMEOUT=3000
rc=`which rc`
args=`which rtags_args`
[ -n "$args" ] && RTAGS_ARGS="$RTAGS_ARGS `$args \"$@\"`"

if [ -z "$RTAGS_DISABLED" ] && [ -x "$rc" ]; then
$rc --timeout=$RTAGS_COMPILE_TIMEOUT $RTAGS_ARGS --silent --compile "$i" "$@" &
Expand Down

0 comments on commit c41b0a3

Please sign in to comment.