I'm following the instructions on http://mongoc.org/libmongoc/current/installing.html#building-on-windows-with-mingw-w64-and-msys2 .
First, I had to use a single dot `.` at the end of the command, as the docs instruct to untar and enter the source code directory.
```
$ CC=/mingw64/bin/gcc.exe /mingw64/bin/cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX="D:/install" .
```
The cmake build starts, but than it fails with these messages:
```
fnoro@N-00933732 MINGW64 /d/src/mongo-c-driver
$ make
Scanning dependencies of target bson_shared
[ 0%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.obj
In file included from D:/src/mongo-c-driver/src/libbson/src/bson/bson.h:23,
from D:/src/mongo-c-driver/src/libbson/src/bson/bcon.h:26,
from D:/src/mongo-c-driver/src/libbson/src/bson/bcon.c:24:
D:/src/mongo-c-driver/src/libbson/src/bson/bson-compat.h:27:2: error: #error "__USE_MINGW_ANSI_STDIO > 0 is required for correct PRI* macros"
#error "__USE_MINGW_ANSI_STDIO > 0 is required for correct PRI* macros"
^~~~~
make[2]: *** [src/libbson/CMakeFiles/bson_shared.dir/build.make:63: src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:219: src/libbson/CMakeFiles/bson_shared.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
```