[cfe-users] Relative header include dirs on Reparse

Hippolyte Barraud via cfe-users cfe-users at lists.llvm.org
Tue May 30 01:37:24 PDT 2017


Hi all,

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").
I'm setting `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 ?
Thanks

-- 

------------------------------
This message and any attachments are the property of The CoSMo Company; 
they are strictly confidential and intended solely for the addressees. If 
you are not the intended recipient of this message, please delete it and 
immediately notify the sender. Any use not in accordance with the purpose 
of this message and any dissemination or disclosure, either whole or 
partial, is prohibited except with formal approval.

Ce message et toutes les pieces jointes sont la propriete de The CoSMo 
Company ; ils sont etablis a  l'intention exclusive de ses destinataires et 
sont confidentiels. Si vous recevez ce message par erreur, merci de le 
detruire et d'en avertir immediatement l'expediteur. Toute utilisation non 
conforme a  sa destination, toute diffusion ou toute publication, totale ou 
partielle est interdite, sans autorisation expresse.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20170530/cc2bb3a8/attachment.html>


More information about the cfe-users mailing list