<div>Try using --extra-arg-before=-I'/path/to/clang/include' when run your tool</div><div> </div><div>Use CommonOptionsParser to access given flag:</div><div> </div><div>CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);</div><div>ClangTool Tool(OptionsParser.getCompilations(), OptionsParser.getSourcePathList());</div><div><br /></div><div><br /></div><div>04.08.2020, 11:24, "Yafei Liu via cfe-dev" <cfe-dev@lists.llvm.org>:</div><blockquote><div dir="ltr"><div>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'."</div><div><br /></div>So is there any built-in OptionCategory that can handle "-I" parameters?<div><div><br /></div></div></div>
,<p>_______________________________________________<br />cfe-dev mailing list<br /><a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br /><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br /></p></blockquote>