]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/tools/compilationunits.sh
Merge branch 'martin-t/cvar-descriptions' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / tools / compilationunits.sh
index e835fa67135e5145c0c8bd97ace8512c05492b4f..68f2eb9d5628ae7df244e70e2ef158be1d69124b 100755 (executable)
@@ -38,6 +38,7 @@ QCCDEFS="${QCCDEFS[@]}"
 
 declare -a QCCFLAGS=(
     -std=gmqcc
+    -O3 # optimization to accept variable initialization inside `if (1)` blocks and avoid warnings
     -Wall -Werror
     -futf8
     -freturn-assignments
@@ -74,6 +75,12 @@ function check() {
     done
 }
 
-check client
-check server
-check menu
+if [ ${#@} -eq 0 ]; then
+    check client
+    check server
+    check menu
+else
+    for var in ${@}; do
+        check ${var}
+    done
+fi