[cfe-dev] How to use AST Matchers without using ninja?

Douglas Katzman dougk at google.com
Thu Jul 9 12:57:10 PDT 2015


Add more libraries. One thing you can do is build 'clang-tidy' and use what
it uses, minus the ones with 'tidy' in the name.
These worked for me:

g++ -o try try.o -L lib \
  -lclangTooling \
  -lclangStaticAnalyzerFrontend -lclangFrontend -lclangDriver \
  -lclangParse -lLLVMMCParser -lclangSerialization -lclangSema \
  -lclangEdit -lLLVMBitReader -lLLVMOption -lclangStaticAnalyzerCheckers \
  -lclangStaticAnalyzerCore -lclangAnalysis -lclangAST -lclangASTMatchers \
  -lclangToolingCore \
  -lclangRewrite -lclangLex -lclangBasic -lLLVMCore -lLLVMMC -lLLVMSupport \
  -lpthread -ldl -lz -ltermcap

You may also want to have a look at
http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang
though it seems a bit out-of-date. That makefile doesn't work exactly as-is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150709/c607dd0b/attachment.html>


More information about the cfe-dev mailing list