Sonarlint VS 2022 with CMake Presets

Please provide

  • Operating system: Win 10
  • SonarLint plugin version: newest (7.2.0)
  • Programming language you’re coding in: C/C++
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): no

And a thorough description of the problem / question:
Hey guys,
Some time ago I posted a question how to get sonarlint to work with VS2022 and CMake Presets.
The answer was to use a CMakeSettings and export as Compile Commands

However in the mean time, Microsoft managed to break Ninja generator. When using VS we can only configure our project using the VS2022 Cmake Generator not ninja any more.

Unfortunately CMAKE_EXPORT_COMPILE_COMMANDS does only work for Ninja Generator, not for the VS generator. Therefore the suggested solution does not work for me any more.

=>How far has the CMakePresets integration gone? Are CMake Presets now supported directly?
=>Is there any other way to get sonarlint running.
(Obviously i could open the generated .sln file and sonarlint would work, however I’d like to switch between different configurations, which is the main benefit of using cmake presets)

thx for your help guys :slight_smile:
greets Julian

Hi @JuliusCaesar89 ,

We do not support CMakePresets, we clearly state it in the documentation page: Requirements - Visual Studio.

What I can suggest, is to revert to a working version of VS2022, you can find all release history with precise installation files here: Visual Studio 2022 Release History | Microsoft Learn.