microsoft / vscode-cmake-tools

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

Code Analysis via Presets #1781

Open Zingam opened 3 years ago

Zingam commented 3 years ago

I recently learned about these interesting "CMakeSettings.json" options in Visual Studio 2019:

      "enableMicrosoftCodeAnalysis": true,
      "enableClangTidyCodeAnalysis": true,
      "clangTidyChecks" : ""

I wondered if anything like that could be implemented with the new CMake presets support. It looks like CMake has the solution via the vendor map object. I am not aware if VS2019 will implement any such extensions via CMake presets but it would great to have unified support of the above options. I think this should be considered as an extension to this FR: Enabling code analysis? #1136

https://devblogs.microsoft.com/cppblog/cmake-presets-integration-in-visual-studio-and-visual-studio-code/ https://learn.microsoft.com/en-us/cpp/build/cmake-presets-json-reference?view=msvc-170 https://learn.microsoft.com/en-us/cpp/code-quality/how-to-set-code-analysis-properties-for-c-cpp-projects?view=msvc-170 https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-presets.md https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#condition

bobbrow commented 3 years ago

Thanks for opening an issue for this. It's something we've discussed, but haven't attached a timeline to yet. We're planning on adding clang-tidy integration to cpptools in an upcoming release as well, so code analysis support is on our minds right now.

mickae1 commented 2 weeks ago

Hi, I'm also interested, thx