-
Notifications
You must be signed in to change notification settings - Fork 278
Developer Tools
ccache works as a wrapper for C/C++ compiler and dramatically shorten the building time by caching the temporary files safely. It works even when you clean up your entire build (e.g. git clean -dfx or make clean, if apply).
- MacOS:
brew install ccache - Ubuntu 16.04:
sudo apt install ccache
No configuring needed as CMake will find it and adopt it. It even accelerates build
Two options needed to be appended to ccache config file $HOME/.ccache/ccache.conf.
If the config file or the directory does not exist, you need to create them.
hash_dir = false
base_dir = COMMON_ABSOLUTE_PATH
COMMON_ABSOLUTE_PATH takes the common absolute path of two or more build directories. (e.g. It will be
/home/user/workspaceif you have two build directories/home/user/workspace/zilliqa1and/home/user/workspace/zilliqa2)
See man ccache to select either ccache --clear or ccache --cleanup.
The version (7.0.0+) is required:
-
MacOS:
brew install llvm@7 -
Ubuntu 16.04 (as in http://apt.llvm.org/):
Create file
/etc/apt/sources.list.d/llvm-7.listwith the following contentdeb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 mainThen run
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update sudo apt-get install clang-format-7 clang-tidy-7 -y
Also, pyyaml is required: pip install pyyaml
Use ./build.sh style or add -DLLVM_EXTRA_TOOLS=ON flag to cmake
-
make clang-format: check the codebase against.clang-formatand fail upon any violation. -
make clang-format-fix: apply the suggested changes directly
-
make clang-tidy: check the codebase following.clang-tidyand suggest the changes -
make clang-tidy-fix: apply the suggested changes directly
see cmake/LLVMExtraTools.cmake.
- MacOS:
brew install git-extras - Ubuntu 16.04:
sudo apt-get install git-extras
If you want to check someone's pull-request, you can just do
git pr PR_NUMBER