Xmake project compile command configuration

Please provide

  • Operating system: Ubuntu 22.04 (running in WSL)
  • SonarLint plugin version: 4.3.0
  • Programming language you’re coding in: C++
  • Is connected mode used: no
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:
when editing C++ code in vs-code in a project created by xmake, I keep getting the following popup from sonarlint:

Pressing the “Configure compile commands” results in:

What must I do to enable sonarlint code checking with xmake-based projects?


Welcome to the community!

The docs should get you started.


Hi Ann,

Thanks for your reply

reading the docs, none of the “out of the box” solutions work for xmake generated projects

The docs suggest that generating a compilation database using a custom script “might be the best solution”, but I don’t see an example or instructions how to do that?

Hello :wave: according to the xmake docs, there is a builtin plugin that can generate a compile_commands.json file.

1 Like

Thanks Jean-Baptiste,
That xmake command works perfectly (xmake project -k compile_commands)
All that is left is to figure out how to perform it automatically when creating a new project
thanks again

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.