Skip to content

CompilerInvocation::GetResourcesPath  #64834

Open
@owinebar

Description

@owinebar

I tried to build tool-template.cpp in an out-of-tree project directory based on a recent main checkout (version 18 at this time). I compiled and installed all the llvm projects from this checkout in ${HOME}/dev, including the shared libraries.
The CMakeLists.txt in the out-of-tree project is set to link tool-template to the shared libraries in ${HOME}/dev. tool-template successfully builds, but raises an error when the resulting binary is run on its source.
As alluded to at the end of https://clang.llvm.org/docs/LibTooling.html, the problem is that the resource directory is set relative to the executable in CompilerInvocation::GetResourcesPath. If I move the tool-template executable to ${HOME}/dev/bin, for example, it processes its source with no issue.

It would make more sense, if the executable is dynamically linked to libclang, to determine the resources path relative to the location of libclang.so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:toolingLibToolingquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions