]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Report __FILE__ as relative path
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 21 Apr 2018 06:11:11 +0000 (16:11 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 21 Apr 2018 06:11:39 +0000 (16:11 +1000)
cmake/qcc.sh

index 78119a59615bf0dfdabf5473c4f374ce76519bda..a6038dd59131c5df736e0862c8b29086f6833162 100755 (executable)
@@ -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} \