diff options
author | fanquake <fanquake@gmail.com> | 2024-08-28 15:13:34 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-08-28 15:25:14 +0100 |
commit | 7de0c99804bca98ef159b7b778e6f5b602507d2c (patch) | |
tree | 1188fe02241668cb5f6e71b5e591ecaea151d5ac | |
parent | 0c90fc644395d1a3861a95dd46c6b1909af45784 (diff) |
doc: update dev note examples for CMake
-rw-r--r-- | doc/developer-notes.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 3066aabe60..99c263bed5 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -214,14 +214,14 @@ int main() To run clang-tidy on Ubuntu/Debian, install the dependencies: ```sh -apt install clang-tidy bear clang +apt install clang-tidy clang ``` -Then, pass clang as compiler to configure, and use bear to produce the `compile_commands.json`: +Configure with clang as the compiler: ```sh -./autogen.sh && ./configure CC=clang CXX=clang++ -make clean && bear --config src/.bear-tidy-config -- make -j $(nproc) +cmake -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +cmake --build build -j $(nproc) ``` The output is denoised of errors from external dependencies. @@ -229,13 +229,13 @@ The output is denoised of errors from external dependencies. To run clang-tidy on all source files: ```sh -( cd ./src/ && run-clang-tidy -j $(nproc) ) +( cd ./src/ && run-clang-tidy -p ../build -j $(nproc) ) ``` To run clang-tidy on the changed source lines: ```sh -git diff | ( cd ./src/ && clang-tidy-diff -p2 -j $(nproc) ) +git diff | ( cd ./src/ && clang-tidy-diff -p2 -path ../build -j $(nproc) ) ``` Coding Style (Python) |