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 454 forks source link

compile_commands.json is not generated for clang-cl kits #4144

Closed AnonN10 closed 1 week ago

AnonN10 commented 2 weeks ago

compile_commands.json file which is consumed by clangd is not generated for clang-cl kits, as a workaround one has to use gcc just for that purpose

Amy-Li03 commented 2 weeks ago

I can reproduce this issue in CMake Tools release version: v1.19.52, the repro steps as below video: @gcampbell-msft please confirm if this is a real issue? Image

gcampbell-msft commented 1 week ago

@Amy-Li03 @AnonN10

Based on the documentation here: https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html, CMAKE_EXPORT_COMPILE_COMMANDS is only supported for Unix Makefiles generator and Ninja.

Therefore, I believe this is expected. I will close as by design for now, I would encourage you to request this on an issue in the Kitware repository. Thanks!