MXE: Windows cross-compile environment for Unix
mxe.cc
mxe.cc
Apparently there are now 222 cross-compiled Windows packages: https://admin.fedoraproject.org/pkgdb/packages/mingw-%2A/
(Disclaimer: I was involved with this project at the beginning, but I've not used it for a while)
My experience with C and C++ is that, as great as the differences between Windows and Unix APIs are, the real friction comes from the differences in compilers and toolchains.
There is much good to be said about Visual Studio. But if you are interested in cross-platform, it is probably a lot easier to maintain a single Unix-based build system as long as you have an easy way to test the products under Windows.
But it is difficult to imagine what is compiled by the MingGW toolchain other than Windows binaries.
Arguably the table entries "i686-w64-mingw32" and "x86_64-w64-mingw32" also explicitly name Windows, in a very cryptic, GNU-specific way.
https://github.com/FiloSottile/homebrew-musl-cross
$ brew install FiloSottile/musl-cross/musl-cross
It's pretty cool seeing these long lived projects going from strength to strength
Some non-Linux Unix have Linux emulation and can translate a subset of Linux syscalls. Perhaps it could be in a chroot with all the needed Linux libraries and utils.
But I am curious if there have been existing projects aimed at this goal.