From e62b8c308daeb8a81539568f27d71a4a5b21ca7c Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 21 Apr 2018 16:11:11 +1000 Subject: [PATCH] Report __FILE__ as relative path --- cmake/qcc.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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} \ -- 2.39.2