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

clangd can't find includes if clang is build with nonstandard CLANG_RESOURCE_DIR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 8.0.0-rc1
    • Qt Creator 8.0.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • Operating System: Gentoo Linux 2.8
      Qt Version: 5.15.5
      Kernel Version: 5.18.5-gentoo (64-bit)
    • 88956d1e9b (qt-creator/qt-creator/8.0) 88956d1e9b (qt-creator/tqtc-qt-creator/8.0)

    Description

      In Gentoo, the clang buildĀ passes -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}" and installs clang's system headers to /usr/lib/llvm/14/bin/../../../../lib/clang/${clang_version}/include/ (i.e., /usr/lib/clang/${clang_version}/include/). But ClangdClient::ClangdClient calls clangdIncludePath which seems to implicitly assume that the headers are where they would otherwise be if CLANG_RESOURCE_DIR defaulted to "". Presumably, this appears to be why the correct header path doesn't show up in the "Header Paths" section of the "C++ Code Model Inspector" and is not being found by clangd.

      Shouldn't clang -print-resource-dir be employed to help find the correct include path at runtime?

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-27760
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            hodorgasm Peter Levine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes