[cfe-dev] Can clangtool handle "-I"?

Yafei Liu via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 4 04:12:28 PDT 2020


Hi Samins, that works for me, thank you.

On Tue, Aug 4, 2020 at 6:55 PM samins KAlex <rldoc at yandex.ru> wrote:

> Try using --extra-arg-before=-I'/path/to/clang/include' when run your tool
>
> Use CommonOptionsParser to access given flag:
>
> CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
> ClangTool Tool(OptionsParser.getCompilations(),
> OptionsParser.getSourcePathList());
>
>
> 04.08.2020, 11:24, "Yafei Liu via cfe-dev" <cfe-dev at lists.llvm.org>:
>
> I'm writing a tool using AST matcher, and I need to pass the path of the
> clang built-in heads to my tool (or it will error me that "'stddef.h' file
> not found"), so I add `-I/path/to/the/headers` to my tool, but the program
> said that "Unknown command line argument
> '-I/usr/lib/llvm-6.0/lib/clang/6.0.0/include'."
>
> So is there any built-in OptionCategory that can handle "-I" parameters?
>
> ,
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200804/6b49320c/attachment.html>


More information about the cfe-dev mailing list