diff --git a/tools/prepare-build-dir b/tools/prepare-build-dir
index df634e54516fbd07aa4412fb038ea82c36fd61ea..13b18352d100f0a96cb967169abac663c8bbb288 100755
--- a/tools/prepare-build-dir
+++ b/tools/prepare-build-dir
@@ -116,6 +116,6 @@ if grep -F "WARNING: Unknown options:" "${LOGFILE}"; then
 	exit 1
 fi
 
-if [[ ${GITLAB_CI} ]]; then
+if [[ -v GITLAB_CI ]]; then
 	meson configure --no-pager "${ABSOLUTE_BUILDDIR}"
 fi