Skip to content

Commit 6445e67

Browse files
authored
Add notes on various analysis tools
1 parent d7bd72b commit 6445e67

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

02-Use_the_Tools_Available.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
1919
* [CMake](http://www.cmake.org/)
2020
* Consider: https://github.com/sakra/cotire/ for build performance
2121
* Consider: https://github.com/toeb/cmakepp for enhanced usability
22+
* Utilize: https://cmake.org/cmake/help/v3.6/command/target_compile_features.html for C++ standard flags
2223
* [Conan](https://www.conan.io/) - a crossplatform dependency manager for C++
2324
* [C++ Archive Network (CPPAN)](https://cppan.org/) - a crossplatform dependency manager for C++
2425
* [Waf](https://waf.io/)
@@ -138,6 +139,16 @@ Consider using the *treat warnings as errors* setting. `/Wx` with MSVC, `-Werror
138139

139140
## LLVM-based tools
140141

142+
LLVM based tools work best with a build system (such as cmake) that can output a compile command database, for example:
143+
144+
```
145+
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
146+
```
147+
148+
If you are not using a build system like that, you can consider [Build EAR](https://github.com/rizsotto/Bear) which will hook into your build system and generate a compile command database for you.
149+
150+
CMake now also comes with built-in support for calling `clang-tidy` during [normal compilation](https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html).
151+
141152
* [include-what-you-use](https://github.com/include-what-you-use), [example results](https://github.com/ChaiScript/ChaiScript/commit/c0bf6ee99dac14a19530179874f6c95255fde173)
142153
* [clang-modernize](http://clang.llvm.org/extra/clang-modernize.html), [example results](https://github.com/ChaiScript/ChaiScript/commit/6eab8ddfe154a4ebbe956a5165b390ee700fae1b)
143154
* [clang-check](http://clang.llvm.org/docs/ClangCheck.html)
@@ -277,7 +288,7 @@ Don't forget to make sure that your error handling is being tested and works pro
277288

278289
### ClangFormat
279290

280-
[ClangFormat](http://clang.llvm.org/docs/ClangFormat.html) can check and correct code formatting to match organizational conventions automatically.
291+
[ClangFormat](http://clang.llvm.org/docs/ClangFormat.html) can check and correct code formatting to match organizational conventions automatically. [Multipart series](https://engineering.mongodb.com/post/succeeding-with-clangformat-part-1-pitfalls-and-planning/) on utilizing clang-format.
281292

282293
### SourceMeter
283294

0 commit comments

Comments
 (0)