I’m facing a strange behavior with clang libtooling when dealing with relative header paths. I’m using ClangTool to generate ASTUnits (the compiler invocation is fed from a compile_commands file).
In the invocation, we add include directories using relatives paths (ex. “-I…/foo”).
FileSystemOptions::WorkingDir on ClangTool’s FileManager. Doing so I can successfully generate an ASTUnit without errors.
But whenever I ask for a Reparse on the ASTUnit, clanglib doesn’t seems to take into account the working dir I set earlier and my DiagnosticConsumer gets header location errors.
Inspecting the ASTUnit, I see that
astUnit->getFileManager().getFileSystemOpts().WorkingDir is correctly set, but
astUnit->getFileSystemOpts().WorkingDir is empty.
Something I’m missing ?