Skip to content

Instantly share code, notes, and snippets.

@jakob
Last active September 1, 2022 22:19
Show Gist options
  • Save jakob/929ed728c96741a119798647a32618ca to your computer and use it in GitHub Desktop.
Save jakob/929ed728c96741a119798647a32618ca to your computer and use it in GitHub Desktop.
How To Build clangd
#!/bin/bash
set -e
mkdir clangd
cd clangd/
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..
cd llvm/tools/clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../../../..
mkdir build
cd build
cmake -G "Unix Makefiles" ../llvm
make clangd
# Add binary to your $PATH
echo $PWD/bin | sudo tee /etc/paths.d/clangd
@kangzhiheng
Copy link

THX! I use your bash and make clangd (Line 20) successfully, but I have a problem when I run Line 23. I modified Line 23 to sudo update-alternatives --install /usr/bin/clangd clangd ./bin/clangd 100,it‘s OK. Anyway, thx your sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment