]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - cmake/qcc.sh
Merge branch 'Lyberta/KillSound' into 'master'
[xonotic/xonotic-data.pk3dir.git] / cmake / qcc.sh
1 #!/usr/bin/env bash
2 CPP=${CPP:-cpp}
3 QCC=${QCC:-$PWD/../../gmqcc/gmqcc${CMAKE_EXECUTABLE_SUFFIX}}
4 case $1 in
5     compile)
6         for var in "$@"; do case "$var" in
7             -I*)
8                 home=${var:2}
9                 break
10                 ;;
11         esac; done
12         ${CPP} ${@:3} \
13             | sed -E "s|${home}|~|g" \
14             | sed -E 's/^#(line)? ([[:digit:]]+) "(.*)".*/'$'\\\n''#pragma file(\3)'$'\\\n''#pragma line(\2)/g' \
15             > $2
16     ;;
17     link)
18         ${QCC} \
19         -std=gmqcc \
20         -Ooverlap-locals \
21         -O3 \
22         -Werror -Wall \
23         -Wno-field-redeclared \
24         -flno -futf8 -fno-bail-on-werror \
25         -frelaxed-switch -freturn-assignments \
26         ${@:2}
27     ;;
28 esac