3
votes

What is the current process to use the mingw toolchain that is included with cygwin?

There use to be a -mno-cygwin option used with gcc.

The mingw versions have x86_64-w64-mingw32- or i686-w64-mingw32- added to their exe names. Currently I just use these directly but I want to use cmake.

Cygwin also includes cmake. How would I configure it to use the mingw toolset that is included with cygwin? I also see some Qt5 *.cmake modules included in the Qt5 libraries for mingw.

Thanks.

1
No time to write a detailed answer, but the right solution is to create a cmake toolchain file and use it with cmake -DCMAKE_TOOLCHAIN_FILE=... I just blogged about it here: smallissimo.blogspot.com/2021/02/… See also gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/… or gist.github.com/peterspackman/8cf73f7f12ba270aa8192d6911972fe8aka.nice

1 Answers

1
votes

I've found a temporary workaround. Just define these two environment variables:

set CC=/usr/bin/x86_64-w64-mingw32-gcc.exe
set CXX=/usr/bin/x86_64-w64-mingw32-g++.exe

Define them before running the cmake that is included with cygwin. Seems to work.