Skip to content

Commit

Permalink
Update clang-format build instructions for Linux
Browse files Browse the repository at this point in the history
Clang-format is now part of the GitHub repository at
https://github.com/llvm/llvm-project/tree/master/clang and requires the
`clang` project to be enabled in the cmake command.

R=hans@chromium.org

Bug: 993206
Change-Id: I6527fd41050550f979836b76b5b86cda2dd36d95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081425
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746334}
  • Loading branch information
TimvdLippe authored and Commit Bot committed Mar 3, 2020
1 parent 02df50e commit 3f8a498
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions docs/updating_clang_format_binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,27 @@ Mac & Linux step-by-step:

```shell
# Check out.
export CLANG_REV=198831 # You must change this value (see above)
rm -rf llvm
rm -rf llvm-build
mkdir llvm
mkdir llvm-build
svn co http://llvm.org/svn/llvm-project/llvm/trunk@$CLANG_REV llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk@$CLANG_REV clang
cd ../../llvm-build
export CLANG_REV=56ac9d30d35632969baa39829ebc8465ed5937ef # You must change this value (see above)
git clone https://github.com/llvm/llvm-project
cd llvm-project
git checkout $CLANG_REV
mkdir build
cd build

# On Mac, do the following:
MACOSX_DEPLOYMENT_TARGET=10.9 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ../llvm/
time caffeinate ninja clang-format
strip bin/clang-format

#On Linux, do the following:
# On Linux, do the following:
# Note the relative paths that point to your local Chromium checkout.
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO \
-DCMAKE_C_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang \
-DCMAKE_CXX_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang++ \
-DCMAKE_ASM_COMPILER=$PWD/../chrome/src/third_party/llvm-build/Release+Asserts/bin/clang \
-DCMAKE_C_COMPILER=$PWD/../../chromium/src/third_party/llvm-build/Release+Asserts/bin/clang \
-DCMAKE_CXX_COMPILER=$PWD/../../chromium/src/third_party/llvm-build/Release+Asserts/bin/clang++ \
-DCMAKE_ASM_COMPILER=$PWD/../../chromium/src/third_party/llvm-build/Release+Asserts/bin/clang \
-DLLVM_ENABLE_TERMINFO=OFF -DCMAKE_CXX_STANDARD_LIBRARIES="-static-libgcc -static-libstdc++" ../llvm/
ninja clang-format
strip bin/clang-format
Expand Down

0 comments on commit 3f8a498

Please sign in to comment.