A compilation error occurs on mapcache_detail.c when OGR / GEOS external packages are disabled (cmake -DWITH_OGR=0 -DWITH_GEOS=0 ..), complaining about undeclared STDERR_FILENO.
The insertion of #include <unistd.h> at the beginning of the file solves the issue.