I found some issues when cross compiling for windows on linux using MINGW (specifically, using MXE):
At duv.h some of the S_ISDIR, S_ISREG etc are already defined in MINGW, so probably best to define each of those only if it's not defined already.
At uv.cmake, there's Userenv.lib. While this is the correct windows name, MINGW has a convention to use lower-case only file names and so on linux it fails to find it. I suggest to change that to userenv.lib. This will work on linux, and on windows it won't matter since on windows the names are case-insensitive.
At miniz.c there are some functions which are static __forceinline, which is apparently bad in MINGW since it defines forceinline to also be extern. This is the same as this: https://github.com/nothings/stb/issues/116 and apparently for now it's not being fixed in upstream MINGW.
Since miniz.c is not an upstream git repo, this seems to solve it. At line 888 add these (undefine forceinline on anything windows. Regardless, I think the compiler should be able to decide itself what to inline):
I found some issues when cross compiling for windows on linux using MINGW (specifically, using MXE):
duv.h
some of theS_ISDIR
,S_ISREG
etc are already defined in MINGW, so probably best to define each of those only if it's not defined already.uv.cmake
, there'sUserenv.lib
. While this is the correct windows name, MINGW has a convention to use lower-case only file names and so on linux it fails to find it. I suggest to change that touserenv.lib
. This will work on linux, and on windows it won't matter since on windows the names are case-insensitive.miniz.c
there are some functions which arestatic __forceinline
, which is apparently bad in MINGW since it defines forceinline to also be extern. This is the same as this: https://github.com/nothings/stb/issues/116 and apparently for now it's not being fixed in upstream MINGW.Since
miniz.c
is not an upstream git repo, this seems to solve it. At line 888 add these (undefine forceinline on anything windows. Regardless, I think the compiler should be able to decide itself what to inline):