Skip to content

Commit

Permalink
Add link for compilation database
Browse files Browse the repository at this point in the history
Discookie committed Jul 12, 2024
1 parent 1d776fc commit a319e31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ This is a C/C++ code analysis plugin for VSCode that shows bug reports detected

## Setting up your build environment

CodeChecker works by reading a generated compilation database, often called `compile_commands.json`, and executing specific analyses based on that.
CodeChecker works by reading a generated [compilation database], often called `compile_commands.json`, and executing specific analyses based on that.

`CMake` has built-in support for generating a compilation database. Set the environment variable `CMAKE_EXPORT_COMPILE_COMMANDS=ON`, and the compilation database should be inside your build folder.
If you are using the `CMake Tools` extension for VS Code, you can add this flag to the extension settings under `Cmake > Build Environment`.
@@ -50,6 +50,8 @@ If you are using the `CMake Tools` extension for VS Code, you can add this flag

To automate the process, the extension provides ways to run the `CodeChecker log` command automatically. First, in the Extension Settings set `CodeChecker > Executor > Log build command`, and then use either the VS Code Task, or the VS Code command `CodeChecker: Run CodeChecker Log` to execute the analysis. You can also run `CodeChecker: Preview CodeChecker log in terminal` to have more fine-grained control over the parameters passed to CodeChecker.

[compilation database]: https://clang.llvm.org/docs/JSONCompilationDatabase.html

## Configuring CodeChecker

The extension uses Codechecker version 6.18.2 or later. If your installation path is different, or CodeChecker is not in the the `PATH` environment variable, the path to it can be set manually under `Preferences > Settings > Extensions > CodeChecker > Executable path`.

0 comments on commit a319e31

Please sign in to comment.