bmx-ng / bmk

The enhanced BlitzMax build program.
zlib License
28 stars 13 forks source link

when using later mingw versions such as TDM-GCC 10.3.0, GCCVersion returns cpu count only. #114

Closed braxtonrivers closed 2 years ago

braxtonrivers commented 2 years ago

Thank you for looking at process on windows. I am happy to report that as an added bonus later versions of mingw now also appear to work since the changes, which makes debugging on windows even easier, and allows me to finally use just a single install of mingw with gcc optimisations and fixes that also works with wx wigdets :)

Unexpected Behaviour on windows 10 x64 using latest bmk-3.48 mt-win32-x64 I did notice that with later mingw versions such as TDM-GCC 10.3.0 on windows x64 that it does not appear to return the version through process.err from GCCVersion, it would enter twice and only contain the cpu count, in my case it would always end up as " "+"(cpu x 12)"

When changed to process.pipe and "--version" it appears to work as expected, and with the current git release version using mingw 8.1 it returns "gcc 080100 (cpu x 12)"

I also added process.Close to the version functions in case it may be needed, apologies I am unable to test for mac and linux.

bmk_ng.bmx 511:

        If Platform() = "win32" Then
            process = CreateProcess(MinGWBinPath() + "/gcc.exe --version", HIDECONSOLE)
        Else

or similar to BCCVersion:

        Local exe:String = "gcc"
        If Platform() = "win32" Then
            exe :+ ".exe"
            process = CreateProcess(MinGWBinPath() + "/"+exe+" --version", HIDECONSOLE)
        Else
            process = CreateProcess(exe+" -v")
        End If

525:

            Local line:String = process.pipe.ReadLine()

@ lines: 568, 618, & 687

        Wend
        If process Then process.Close()