-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake: MINGW implies WIN32 #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this assumption is valid, I will need to investigate as there are two use cases for mingw, 1. On windows compiling as linux and 2. On linux compiling for windows (on windows for windows would be included).
Of course I am not sure about (1) as I have not tried that environment, and might be confusing it with cygwin. |
I was confusing cygwin and mingw, however: UNIX : is TRUE on all UNIX-like OS's, including Apple OS X and WIN32 : is TRUE on Windows. Prior to 2.8.4 this included CygWin APPLE : is TRUE on Apple systems. Note this does not imply the MINGW : is TRUE when using the MinGW compiler in Windows MSYS : is TRUE when using the MSYS developer environment in Windows CYGWIN : is TRUE on Windows when using the CygWin version of cmake NOTE that there is not a mention of MINGW on linux, however, if you are using mingw on linux then WIN32 will not be set and that is the reason for the :if (WIN32 OR MINGW) uses. |
no, MINGW is also set when crosscompiling from linux from my experience |
Right, but on linux it will not set "WIN32" so you need to check for "MINGW" as well. |
no, as the target platform is also windows, WIN32 is also set: |
maybe you're confusing host platform and target platform ? |
maybe I am. Is it possible to have WIN32 not defined, yet have MINGW defined. If not then I agree with these changes. We will need to test. |
afaik the mingw toolchain can only target the windows platform so WIN32 would always be set |
okay, "if(WIN32 OR MINGW") == "if(WIN32)" - but now the tricky part - we need to differentiate between what is target settings vs build time settings - when building on linux, paths will need to be unix style (runtest.cmake). In this case we will need |
Wait that's not right either, "if(MINGW AND NOT {HOST is WINDOWS})" |
In general there's no need to tweak paths because cmake uses the unix convention internally, except maybe when calling native tools. |
That's good. I may need to setup a MINGW on Windows test machine - I haven't had much luck previously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like java and plugin tests will need investigation because of use of path and classpath changes.
Otherwise everything looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good, if at some time in the future this gets tested on a windows machine with mingw and issues are found - a new PR can be discussed.
hdf5 requires cmake 3, so we can simplify these