Skip to content

Commit 8f761ea

Browse files
committed
Merge bitcoin/bitcoin#30739: doc: update dev note examples for CMake
7de0c99 doc: update dev note examples for CMake (fanquake) Pull request description: Update the examples in the developer notes to work with CMake. Also added an explicit `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` for clarity. ACKs for top commit: davidgumberg: Tested ACK bitcoin/bitcoin@7de0c99 TheCharlatan: ACK 7de0c99 jonatack: Tested ACK 7de0c99 on arm64 macOS 14.6.1 Tree-SHA512: 561fe5e777c5b29a4f26309700c03a730c5bbb2f838630abfaa4174112ced66e733c2109cb429a1927f1f3692bf1945f6386bcaffe604a76ea24633932d39171
2 parents 00ad716 + 7de0c99 commit 8f761ea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/developer-notes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,28 +214,28 @@ int main()
214214
To run clang-tidy on Ubuntu/Debian, install the dependencies:
215215
216216
```sh
217-
apt install clang-tidy bear clang
217+
apt install clang-tidy clang
218218
```
219219

220-
Then, pass clang as compiler to configure, and use bear to produce the `compile_commands.json`:
220+
Configure with clang as the compiler:
221221

222222
```sh
223-
./autogen.sh && ./configure CC=clang CXX=clang++
224-
make clean && bear --config src/.bear-tidy-config -- make -j $(nproc)
223+
cmake -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
224+
cmake --build build -j $(nproc)
225225
```
226226

227227
The output is denoised of errors from external dependencies.
228228

229229
To run clang-tidy on all source files:
230230

231231
```sh
232-
( cd ./src/ && run-clang-tidy -j $(nproc) )
232+
( cd ./src/ && run-clang-tidy -p ../build -j $(nproc) )
233233
```
234234

235235
To run clang-tidy on the changed source lines:
236236

237237
```sh
238-
git diff | ( cd ./src/ && clang-tidy-diff -p2 -j $(nproc) )
238+
git diff | ( cd ./src/ && clang-tidy-diff -p2 -path ../build -j $(nproc) )
239239
```
240240

241241
Coding Style (Python)

0 commit comments

Comments
 (0)