Failed to compile using Cygwin

I am trying to compile hdf5-1.12.2 using Cygwin. I downloaded the source code.
I executed the commands below:

mkdir build
cd build
cmake -G "Unix Makefiles" -DHDF5_BUILD_CPP_LIB=ON -DBUILD_SHARED_LIBS=ON ..
make

I got an error:

C:/workspace/hdf5-1.12.2/src/H5system.c:483:9: error: unknown type name 'errno_t'; did you mean 'errno'?
  483 |         errno_t err;
      |         ^~~~~~~
      |         errno

Could you please help me resolve this error?

Thanks

Have you tried the instructions here:

You may also be interested in the msys2 build recipe for HDF5: