Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-29529

Add the ability to use compile_commands.json for clang-tidy

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • None

    Description

      I have really weird build system, that generates huge commandline for each file. As far as I understand OS simply can't handle so long command line, and I get following error

      16:55:31: Running Clang-Tidy on D:\CMakeLists.txt with configuration "Almost everything(no Clazy)".
      Analyzing "D:\foo.cpp" [Clang-Tidy].
      Failed to analyze "D:\foo.cpp": An error occurred with the Clang-Tidy process.
      Command line: <683575 chars long command line>
      Process Error: 0
      Output:
      16:55:31: Error: Failed to analyze 1 files.
      16:55:31: Clang-Tidy finished: Processed 0 files successfully, 1 failed.
      16:55:31: Elapsed time: 00:00.
      

      clangd, in turn, works just fine. I assume, that is so, because it uses compile_commands.json. If I take clang-tidy's command line and simply replace all compiler flags with

      -p C:\Users\me\AppData\Roaming\QtProject\qtcreator\.qtc_clangd\default\
      

      it works just fine. I wanted to rebuild clangtools and hardcode the falg here , but I'm not smart enough to do it on my own.

      Maybe somabody can add setting "Use custom compile_commands.json", or even "Use clangd's compile_commands.json"?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            yrhetatejlb yrhetatejlb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes