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

Compilation Database doesn't handle relative --sysroot

    XMLWordPrintable

Details

    • All
    • e6bda58033befaa0d013a826637e8e966410a5b5 (qt-creator/qt-creator/master)

    Description

      The recently landed change to have the Compilation Database plugin parse --sysroot (thanks!) doesn't seem to handle relative paths. The following was sufficient to fix the problem for me:

      diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp
      index ff931cc387..9a9411ee46 100644
      --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp
      +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp
      @@ -185,7 +185,7 @@ void filteredFlags(const QString &fileName,
       
               if (flag.startsWith("--sysroot=")) {
                   if (sysRoot.isEmpty())
      -                sysRoot = flag.mid(10);
      +                sysRoot = updatedPathFlag(flag.mid(10), workingDir);
                   continue;
               }
       
      

      Thanks again!

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            erikjensen Erik Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes