You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. Install `protobufs` in `external/protobufs/_build/protobuf-install`
80
-
84
+
81
85
`cmake --build _build -t install`
82
86
83
87
## Build
84
88
85
89
Prerequisites
90
+
86
91
- CMake >= 3.30
92
+
87
93
- Ninja
94
+
88
95
- C compiler that supports at least C11
96
+
89
97
- C++ compiler that supports at least C++20
98
+
90
99
- Python3 >= 3.9 with python3-venv installed
91
-
- Gcovr (optional)
92
100
101
+
- Gcovr (optional)
93
102
1. Setup Protobufs for the version(s) of the library being built. See [Protobufs](#protobufs).
94
103
95
104
2. See the `docs` directory for how to perform static analysis and code formatting. **You must set up Cppcheck and Uncrustify before configuring CMake.**
96
105
97
106
3. Configure CMake.
98
-
107
+
99
108
`cmake -B build -G Ninja` or `cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCAVETALK_BUILD_TESTS=ON` to build with tests
100
109
101
110
4. Run the static analysis and code formatting tools.
102
-
111
+
103
112
- Cppcheck: `cmake --build build -t cppcheck`
104
113
- Uncrustify: `cmake --build build -t uncrustify`
105
114
106
115
5. Build the project.
107
-
116
+
108
117
`cmake --build build`
109
118
110
119
6. If the project was configured to build tests, run the tests.
111
-
120
+
112
121
`cmake --build build -t test`
113
122
114
123
7. If the project was configured to build tests and Gcovr is installed, generate a coverage report. The coverage report can be found in the `build` directory at `coverage.html`.
115
-
124
+
116
125
`cmake --build build -t coverage-no-test` or `cmake --build build -t coverage` to run the tests and generate the coverage report in a single command
Copy file name to clipboardExpand all lines: docs/cppcheck.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,6 @@ To setup Cppcheck in a local repository, follow these steps:
22
22
23
23
Cppcheck can now be run from the repository root with `cmake --build build -t cppcheck` assuming CMake has been configured with build directory `build`.
24
24
25
-
To enable the pre-commit hook that automatically runs Cppcheck before each commit, run `git config core.hooksPath tools/hooks`. Note: This pre-commit hooks may also run other checks.
25
+
To enable the pre-commit hook that automatically runs Cppcheck before each commit, run `git config core.hooksPath tools/hooks`. Note: This pre-commit hooks may also run other checks.
26
+
27
+
Cppcheck outputs to `build/cppcheck_report.xml` for debugging failed checks
0 commit comments