Quake used Djgpp. Doom, the earlier game from Id Software, used the commercial Watcom C/C++ compiler. Watcom was the go to solution for most 32-bit DOS games during 90s.
I used DJGPP quite a bit for several projects at work a few years ago. Worked really well. I was happy to use modern versions of C++ compilers for DOS apps.
Found this:
"Build DJGPP cross compiler and binutils on Windows (MinGW/Cygwin), Mac OSX and Linux"