From: TimePath Date: Sat, 21 Apr 2018 06:11:11 +0000 (+1000) Subject: Report __FILE__ as relative path X-Git-Tag: xonotic-v0.8.5~2181 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e62b8c308daeb8a81539568f27d71a4a5b21ca7c;p=xonotic%2Fxonotic-data.pk3dir.git Report __FILE__ as relative path --- diff --git a/cmake/qcc.sh b/cmake/qcc.sh index 78119a596..a6038dd59 100755 --- a/cmake/qcc.sh +++ b/cmake/qcc.sh @@ -3,7 +3,16 @@ CPP=${CPP:-cpp} QCC=${QCC:-$PWD/../../gmqcc/gmqcc${CMAKE_EXECUTABLE_SUFFIX}} case $1 in compile) - ${CPP} ${@:3} | sed -E 's/^#(line)? ([[:digit:]]+) "(.*)".*/'$'\\\n''#pragma file(\3)'$'\\\n''#pragma line(\2)/g' > $2 + for var in "$@"; do case "$var" in + -I*) + home=${var:2} + break + ;; + esac; done + ${CPP} ${@:3} \ + | sed -E "s|${home}|~|g" \ + | sed -E 's/^#(line)? ([[:digit:]]+) "(.*)".*/'$'\\\n''#pragma file(\3)'$'\\\n''#pragma line(\2)/g' \ + > $2 ;; link) ${QCC} \