]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/test/compilationunit.sh
Merge branch 'master' into terencehill/tooltips_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / test / compilationunit.sh
1 #!/bin/bash
2 set -eu
3 cd "$(dirname "$0")"
4 cd ..
5
6 declare -a NOWARN=(
7   -Wno-field-redeclared
8   -Wno-unused-variable
9   -Wno-implicit-function-pointer
10 )
11 declare -a FEATURES=(
12   -DVEHICLES_ENABLED=1
13   -DVEHICLES_USE_ODE=0
14 )
15 declare QCC=../../../gmqcc/gmqcc
16
17 declare -a QCC_FLAGS=(
18   -std=gmqcc
19   -Wall -Werror
20   -fftepp -fftepp-predefs -Wcpp
21   -futf8
22   -freturn-assignments
23   -frelaxed-switch
24   -O3
25 )
26
27 function check() {
28   declare -l base="${1}"
29   declare -la predefs=("-D${2}" "lib/_all.inc" "${base}/_all.qh")
30   find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
31     echo "$file"
32     ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${FEATURES[@]}" "${predefs[@]}" "$file" >/dev/null
33   done
34 }
35
36 check client CSQC
37 check server SVQC
38 check menu MENUQC