Can a MINGW definition be added as a platform in playdate_game.cmake for compiling for simulator using (mingw) gcc?

On windows it is possible to use the mingw32 (64bit) gcc compiler instead of visual studio c compiler as well and all thats needed is to add a MINGW definition in playdate_game.cmake

like this :

elseif (MINGW)
        COMMAND ${CMAKE_COMMAND} -E copy

then people can run a msys2 prompt with mingw32 (64 bit version) and run
cmake .. -G "MSYS Makefiles" to generate the make file and then
make to compile the pdex.dll etc

this dll loads fine in the simulator when i tested it.

i think this setup might be easier to setup for compiling C programs with visual studio code if people already have that installed as you can load a msys prompt inside visual studio code. Its how i usually compile windows program's using gcc (mingw) toolchains in windows

I did not test it but theoretically it might allow for debugging using gdb debugger inside visual studio code as well


+1 would love to have clang added to the cmake for windows sim

MSVC is becoming increasingly out of date, both with modern C standards (visual studio still barfs on designated initializers), as well as common extensions (e.g. attribute((cleanup)) that all other compilers support (clang, gcc, hell even intel's obscure compiler supports this!).

Just filed an merge request for adding this. Thanks! :slight_smile:


thank you for doing this

1 Like