microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.47k stars 452 forks source link

Scan for Kits can't detect different MinGW compilers if they have the same version #2640

Open pbaret opened 2 years ago

pbaret commented 2 years ago

Brief Issue Summary

When building C/C++ project on windows using MinGW compiler you have several options for a given version. Let's say I use MinGW 8.1.0 x86_64, so GCC 8.1.0 64 bits.

There are several implementation of the corresponding MinGW on windows:

Some projects will use one or the other depending on the final target or also on the libraries they are using (if the library is built with sjlj, can't compile your program with seh exception handling).

As a consequence some people might want to put in their path for example :

The problem is that the "Scan for kits" command only displays "GCC 8.1.0 x86_64-w64-mingw32" for each one, and because of that, in the final list of kits displayed, we only see the last one of the path (the others probably getting overridden).

Suggestion:

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

elahehrashedi commented 2 years ago

We are aware of this issue. Adding different compilers causes an issue on Linux. Until the time we can find a way to solve this issue for windows without causing issues in Linux, you can use this workaround. As a workaround, you can add your own kit, by making a copy of the detected kit and modifying it.

bobbrow commented 2 years ago

More information on adding additional kits can be found here: https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/kits.md

pbaret commented 2 years ago

Sorry for the duplicate then and thank you for the very quick reply. Thank you also for the work around, I'll check that out.