OLD | NEW |
1 # Updating Clang format binaries | 1 # Updating Clang format binaries |
2 | 2 |
3 Instructions on how to update the [clang-format binaries](clang_format.md) that | 3 Instructions on how to update the [clang-format binaries](clang_format.md) that |
4 come with a checkout of Chromium. | 4 come with a checkout of Chromium. |
5 | 5 |
6 ## Prerequisites | 6 ## Prerequisites |
7 | 7 |
8 You'll need a Windows machine, a Linux machine, and a Mac; all capable of | 8 You'll need a Windows machine, a Linux machine, and a Mac; all capable of |
9 building clang-format. You'll also need permissions to upload to the appropriate | 9 building clang-format. You'll also need permissions to upload to the appropriate |
10 google storage bucket. Chromium infrastructure team members have this, and | 10 google storage bucket. Chromium infrastructure team members have this, and |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 Follow the official instructions here: | 22 Follow the official instructions here: |
23 http://clang.llvm.org/get_started.html. | 23 http://clang.llvm.org/get_started.html. |
24 | 24 |
25 Windows step-by-step: | 25 Windows step-by-step: |
26 | 26 |
27 ```shell | 27 ```shell |
28 # [double check you have the tools you need] | 28 # [double check you have the tools you need] |
29 where cmake.exe # You need to install this. | 29 where cmake.exe # You need to install this. |
30 where svn.exe # Maybe fix with: set PATH=%PATH%;D:\src\depot_tools\svn_bin | 30 where svn.exe # Maybe fix with: set PATH=%PATH%;D:\src\depot_tools\svn_bin |
31 "c:\Program Files (x86)\Microsoft Visual Studio 12.0\vc\vcvarsall.bat" amd64_x86 | 31 "c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\vcvarsall.bat" amd64_x86 |
32 | 32 |
33 set CLANG_REV=198831 # You must change this value (see above) | 33 set CLANG_REV=198831 # You must change this value (see above) |
34 | 34 |
35 [from a clean directory, check out and build] | 35 [from a clean directory, check out and build] |
36 rmdir /S /Q llvm | 36 rmdir /S /Q llvm |
37 rmdir /S /Q llvm-build | 37 rmdir /S /Q llvm-build |
38 mkdir llvm | 38 mkdir llvm |
39 mkdir llvm-build | 39 mkdir llvm-build |
40 svn co http://llvm.org/svn/llvm-project/llvm/trunk@%CLANG_REV% llvm | 40 svn co http://llvm.org/svn/llvm-project/llvm/trunk@%CLANG_REV% llvm |
41 cd llvm\tools | 41 cd llvm\tools |
42 svn co http://llvm.org/svn/llvm-project/cfe/trunk@%CLANG_REV% clang | 42 svn co http://llvm.org/svn/llvm-project/cfe/trunk@%CLANG_REV% clang |
43 cd ..\..\llvm-build | 43 cd ..\..\llvm-build |
44 set CC=cl | 44 set CC=cl |
45 set CXX=cl | 45 set CXX=cl |
46 cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT \ | 46 cmake -G Ninja ..\llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT ^ |
47 -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO \ | 47 -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ^ |
48 -DPYTHON_EXECUTABLE=d:\src\depot_tools\python276_bin\python.exe | 48 -DPYTHON_EXECUTABLE=d:\src\depot_tools\python276_bin\python.exe |
49 ninja clang-format | 49 ninja clang-format |
50 bin\clang-format.exe --version | 50 bin\clang-format.exe --version |
51 ``` | 51 ``` |
52 | 52 |
53 Mac & Linux step-by-step: | 53 Mac & Linux step-by-step: |
54 | 54 |
55 ```shell | 55 ```shell |
56 # Check out. | 56 # Check out. |
57 export CLANG_REV=198831 # You must change this value (see above) | 57 export CLANG_REV=198831 # You must change this value (see above) |
58 rm -rf llvm | 58 rm -rf llvm |
59 rm -rf llvm-build | 59 rm -rf llvm-build |
60 mkdir llvm | 60 mkdir llvm |
61 mkdir llvm-build | 61 mkdir llvm-build |
62 svn co http://llvm.org/svn/llvm-project/llvm/trunk@$CLANG_REV llvm | 62 svn co http://llvm.org/svn/llvm-project/llvm/trunk@$CLANG_REV llvm |
63 cd llvm/tools | 63 cd llvm/tools |
64 svn co http://llvm.org/svn/llvm-project/cfe/trunk@$CLANG_REV clang | 64 svn co http://llvm.org/svn/llvm-project/cfe/trunk@$CLANG_REV clang |
65 cd ../../llvm-build | 65 cd ../../llvm-build |
66 | 66 |
67 # Option 1: with cmake | 67 # Option 1: with cmake |
68 MACOSX_DEPLOYMENT_TARGET=10.9 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \ | 68 MACOSX_DEPLOYMENT_TARGET=10.9 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \ |
69 -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ../llvm/ | 69 -DLLVM_ENABLE_ASSERTIONS=NO -DLLVM_ENABLE_THREADS=NO ../llvm/ |
70 time caffeinate ninja clang-format | 70 time caffeinate ninja clang-format |
71 strip bin/clang-format | 71 strip bin/clang-format |
72 | 72 |
73 # (On Linux, to build with clang, which produces smaller binaries, add this to | 73 # (On Linux, to build with clang, which produces smaller binaries, add this to |
74 # your cmake invocation. | 74 # your cmake invocation. |
75 # On Mac, the system compiler is already clang so it's not needed there.) | 75 # On Mac, the system compiler is already clang so it's not needed there.) |
76 -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+As
serts/bin/clang++ | 76 -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+As
serts/bin/clang++ |
77 ``` | 77 ``` |
78 | 78 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 The binaries were built at clang revision ####### on ####DATETIME####. | 115 The binaries were built at clang revision ####### on ####DATETIME####. |
116 | 116 |
117 BUG= | 117 BUG= |
118 | 118 |
119 The change should **always** include new `.sha1` files for each platform (we | 119 The change should **always** include new `.sha1` files for each platform (we |
120 want to keep these in lockstep), should **never** include `clang-format` | 120 want to keep these in lockstep), should **never** include `clang-format` |
121 binaries directly. The change should **always** update `README.chromium` | 121 binaries directly. The change should **always** update `README.chromium` |
122 | 122 |
123 clang-format binaries should weigh in at 1.5MB or less. Watch out for size | 123 clang-format binaries should weigh in at 1.5MB or less. Watch out for size |
124 regressions. | 124 regressions. |
OLD | NEW |