Experiments developing tools using Clang LibTooling.
- Using llvmorg-16.0.6
- Ninja is used to build LLVM/Clang.
LLVM/CLANG takes forever to build. To expedite development on tools a standalone build is established following docs.
This step is carried out by build_standalone_llvm_clang.py1 which loads configurations from llvm-build-config.jsonc2.
The assumed default directory structure is as follows:
<root>
+---llvm
+---clang-libtooling-experiments
| +---build_standalone_llvm_clang.py
| \---example
+---build-llvm
+---build-clang
+---llvm-release
The setup_llvm_clang.py module exists to help establish this dependency.
py setup_llvm_clang.py -hto see help output
py setup_llvm_clang.py --writeconfigto create the default configuration file:llvm-config.json- Change as necessary (desired directories and vcvarsbat)
- NOTE: this will overwrite
llvm-config.jsonif it exists!
py setup_llvm_clang.py --cloneto clone the required LLVM repo (out of tree).py setup_llvm_clang.py --llvm --clangto compile the dependencies.
NOTE Once LLVM/Clang is compiled the resource should be maintained to mitigate lengthy compile times in the future.
The default configuration will result in the following hierarchy when py setup_llvm_clang.py --clone --llvm --clang is executed from this directory:
. <root-dir>
/binder (*this*)
setup_llvm_clang.py
llvm-config.json (generated by setup_llvm_clang.py)
/llvm .. cloned github branch (tag)
/build-llvm .. llvm build directory
/build-clang .. clang build directory
/llvm-reldbg .. generated llvm/clang binaries