Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • tools
  • testing
  • kunit
  • kunit_kernel.py
Find file BlameHistoryPermalink
  • Brendan Jackman's avatar
    kunit: tool: Build compile_commands.json · e4835f1d
    Brendan Jackman authored May 16, 2024
    compile_commands.json is used by clangd[1] to provide code navigation
    and completion functionality to editors. See [2] for an example
    configuration that includes this functionality for VSCode.
    
    It can currently be built manually when using kunit.py, by running:
    
      ./scripts/clang-tools/gen_compile_commands.py -d .kunit
    
    With this change however, it's built automatically so you don't need to
    manually keep it up to date.
    
    Unlike the manual approach, having make build the compile_commands.json
    means that it appears in the build output tree instead of at the root of
    the source tree, so you'll need to add --compile-commands-dir=.kunit to
    your clangd args for it to be found. This might turn out to be pretty
    annoying, I'm not sure yet. If so maybe we can later add some hackery to
    kunit.py to work around it.
    
    [1] https://clangd.llvm.org/
    [2] https://github.com/FlorentRevest/linux-kernel-vscode
    
    
    
    Signed-off-by: default avatarBrendan Jackman <jackmanb@google.com>
    Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    e4835f1d
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7