[cmake-developers] [PATCH] CMakeDetermineSystem.cmake distinguishes-MSYS-MINGW32 (was Re: Distinguishing MSYS2

Ray Donnelly mingw.android at gmail.com
Tue Aug 11 17:00:25 EDT 2015


On Tue, Aug 11, 2015 at 9:09 PM, Greg Jung <gvjung at gmail.com> wrote:
> Do note that I am an "observer" or "reporter" and not responsible for the
> posix-version cmake in msys2.  Ray Donnelly is much closer to that than I
> am.
> What I can do, though, is bring in the modules (.cmake files) and make sure
> the changes (already) effected there can co-exist with a normal MSYS (using
> mingw) module collection.  Currently, MSYS is almost exactly parallel to
> CYGWIN and this would need to be either (MSYS AND CMAKE_HOST_UNIX) or (MSYS
> AND NOT MINGW).  Probably the latter.

Greg,

Am I right in reading that you use both MSYS/mingw.org and
MSYS2/MinGW-w64? Most people are sloppy about terminology so it gets
confusing very easily.

>
> Regards,
> Greg
>
> On Tue, Aug 11, 2015 at 6:18 AM, Brad King <brad.king at kitware.com> wrote:
>>
>> On 08/10/2015 04:07 PM, Greg Jung wrote:
>> > There is an msys2-specific cmake version already built along those
>> > lines,
>> > with several patches in the modules section to parallel the CYGWIN
>> > cases,
>> > in the msys2 distribution.  It does not have a "MSYS Makefiles"
>> > generator
>> > option but uses "Unix generator"  as you anticipate.
>>
>> In order to get CMAKE_HOST_UNIX set properly for CMakeDetermineSystem
>> shouldn't we upstream your changes for a msys2-specific CMake?  I presume
>> it does a "#if defined(__MSYS__)" somewhere near where we already do
>> "#if defined(__CYGWIN__)".

You can see our patch to add MSYS2 support here:
https://github.com/Alexpux/MSYS2-packages/blob/master/cmake/cmake-3.2.3-msys.patch
.. #if defined(__MSYS__) is used and we just set CMAKE_SYSTEM_NAME to
MSYS, not MSYS2. If we risk breaking MSYS then we can go for MSYS2 I
guess. We might need to patch a few projects we build in that case,
but that's fine. There's no compiler flag that identifies MSYS2 as
distinct from MSYS though .. I guess GCC version could be used as I'd
be surprised if MSYS update their GCC version again.

In terms of working on this, initially I was actually keen to try to
be able to use MinGW-w64 CMake to build even msys-2.0.dll-linked
software, but I guess I was being hopeful as two other MSYS2
developers disagreed with me :-) Alexey Pavlov did all of the work on
our msys2/cmake package and he's on holiday this month. I've done a
good bit of work on our native MinGW-w64 cmake packages so I know my
way around it a bit, if you want to progress this before then.

Best regards,

Ray.

>>
>> Thanks,
>> -Brad
>>
>


More information about the cmake-developers mailing list