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

Generated compile_commands.json of Qt Creator 4.9-beta1 not loadable by Sourcetrail (worked with 4.8)

    XMLWordPrintable

Details

    • a0072afd492d9653d035b3217ddda954154b2d24 (qt-creator/qt-creator/4.9)

    Description

      Sourcetrail is a very cool cross-platform source explorer for C/C++.

      There is a Qt Creator plugin to support Sourcetrail, but it can also load a compile_commands.json which Qt Creator is able to generate since 4.8.
      Sourcetrail is able to load the 4.8 version of compile_commands.json but unfortunately not the 4.9-beta1 version.

      compile_commands.json (4.8.0):

      [
      {
          "arguments": [
              "clang++",
              "-c",
              "-m32",
              "-target",
              "i686-pc-windows-msvc",
      ...
      

       

      compile_commands.json (4.9-beta1):

      [
      {
          "arguments": [
              "clang++",
              "--driver-mode=cl",
              "-nologo",
              "-Zc:wchar_t",
              "-FS",
      

      The difference seems to be the --driver-mode=cl entry introduced in 4.9.

       

      This is the error message in Sourcetrail:

      I created a Sourcetrail task.

       

      Let's assume that both variants of the compile_commands.json are valid. Would it be possible to have some user options for generating the file? Either when generating or global? I could think of choice of:

      • "arguments" lists vs. "command" value
      • driver mode
      • Filename (with current path as default)

      Attachments

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

        Activity

          People

            yvvan Ivan Donchevskii
            portale Alessandro Portale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes