X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Ftools%2Fcompilationunits.sh;h=7a7ff17b6d554cbe6451ae2dda773ec81b017088;hb=c06a3a14f0ba50c9a5665d98f26c90735df39bde;hp=e835fa67135e5145c0c8bd97ace8512c05492b4f;hpb=e57fd111a3279a4aa4789e2c72f9c819a56c7be9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/tools/compilationunits.sh b/qcsrc/tools/compilationunits.sh index e835fa671..7a7ff17b6 100755 --- a/qcsrc/tools/compilationunits.sh +++ b/qcsrc/tools/compilationunits.sh @@ -38,6 +38,11 @@ QCCDEFS="${QCCDEFS[@]}" declare -a QCCFLAGS=( -std=gmqcc + # Without -O3, GMQCC thinks some variables are used uninitialized if the initialization is done inside an `if (1)` block + # (which is created by e.g. BEGIN_MACRO) which would cause the compilation units test to fail. + # There doesn't appear to be any measurable increase in compile time + # and it allows us to get rid of some explicit initializations which are just useless noise. + -O3 -Wall -Werror -futf8 -freturn-assignments @@ -74,6 +79,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