I want to use clang's LibTooling on Mac OS X Yosemite. Clang's docs only shows how to build clang and llvm, but what I need is LibTooling, not whole clang (xcode has already provided clang and llvm). How to build LibTooling without building another clang?
Building a tool with clang LibTooling, it is not hard.
First, you should git clone <llvm-project>
into somewhere local.
Second, using one of the building tools, e.g., CMake, ninja, make, etc, to generate clang configuration files.
Then, write down your own code in clang/tools/ or clang-tools-extra/ and modify relating cMakeLists.txt to let the building tool know how to build your own tool.
For more specific information, you can refer to How To Setup Clang Tooling For LLVM.
I hope this answer will be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With