I wrote some tool, based on libclang
, which get some file and create translation unit from it and parse ast tree, but the tool needs compile flags, so I must specify all needed flags for compilation the file. So, here is a small problem: I can not specify relative path to incude directories, because for create translation unit the tool create temporary file and copy all input file in it (this is needed, because tool also can work in interactive mode). So paths for temporary file and source file are different. I means that I should set absolute paths in -I
flags of manually parse input flags and check it: is that relative or not? Can I specify some prefix for all relative include directories? Or set current directory for compiler?
Asked
Active
Viewed 155 times
0

Andrej Levkovitch
- 235
- 1
- 11
-
I want to know this to. I have been experimenting with "unsaved files" that you can send as argument, but with no success. – Lasersköld Nov 18 '20 at 21:34
-
1@Lasersköld i didn't find preaty solution for the problem, so I just change relative paths to absolute. You can see how it works here: https://github.com/andrejlevkovitch/vim-hl-client – Andrej Levkovitch Nov 18 '20 at 22:11
-
Hmm.. That might work for me – Lasersköld Nov 21 '20 at 07:13