Skip to content

Clang Format

Peter Doak edited this page Aug 7, 2018 · 2 revisions

Building "enhanced" clang-format

On OSX

First install llvm with homebrew if you haven't already. Also install ninja, its much more efficient than make for a giant project like this. This might work with homebrew gcc too, I doubt it will work for apples compilers.

mkdir compilers
cd compilers
git clone https://github.com/PDoakORNL/llvm-project-20170507.git
cd llvm-project-20170507
git checkout align_consecutive_matching_assignment_operators
cd ..
mkdir llvm7-custom-clang-format
cd llvm7-custom-clang-format
LDFLAGS="-Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib" CC=/usr/local/opt/llvm/bin/clang cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib" -DLLVM_ENABLE_PROJECTS="clang;libcxx" -DCMAKE_INSTALL_PREFIX=/Users/<YOURNAME>/opt/llvm7-custom-clang-format -DLLVM_ENABLE_LIBCXX=On -DLLVM_ENABLE_EH=On -DLLVM_ENABLE_RTTI=On ../llvm-project-20170507/llvm
ninja install
Clone this wiki locally