ci: pass compiler vars to google/benchmark cmake invocation

libeigen/eigen!2500

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/ci/scripts/build.benchmark.sh b/ci/scripts/build.benchmark.sh
index 6fc496d..cd2b1ca 100755
--- a/ci/scripts/build.benchmark.sh
+++ b/ci/scripts/build.benchmark.sh
@@ -16,12 +16,16 @@
 
 # Install Google Benchmark from source if not already present.
 # The common before_script already installs cmake/ninja; we only need
-# git and ca-certificates for the clone.
+# git and ca-certificates for the clone. The CI image only ships
+# versioned compilers (e.g. g++-10), so unversioned c++/cc are absent
+# and we must pass CMAKE_*_COMPILER explicitly.
 if ! pkg-config --exists benchmark 2>/dev/null; then
   apt-get update -qq
   apt-get install -y --no-install-recommends git ca-certificates
   git clone --depth 1 --branch v1.9.1 https://github.com/google/benchmark.git /tmp/gbench
   cmake -G Ninja -S /tmp/gbench -B /tmp/gbench-build \
+    -DCMAKE_C_COMPILER="${EIGEN_CI_C_COMPILER}" \
+    -DCMAKE_CXX_COMPILER="${EIGEN_CI_CXX_COMPILER}" \
     -DCMAKE_BUILD_TYPE=Release \
     -DBENCHMARK_ENABLE_TESTING=OFF \
     -DCMAKE_INSTALL_PREFIX=/usr/local