Manual: -i and --project

This commit is contained in:
Daniel Marjamäki 2019-12-14 13:04:21 +01:00
parent 06752d75a5
commit 267bdc0f5f
1 changed files with 20 additions and 2 deletions

View File

@ -94,7 +94,7 @@ The second option is to use -i, with it you specify files/paths to ignore. With
cppcheck -isrc/c src
This option does not currently work with the `--project` option and is only valid when supplying an input directory. To ignore multiple directories supply the -i multiple times. The following command ignores both the src/b and src/c directories.
This option is only valid when supplying an input directory. To ignore multiple directories supply the -i multiple times. The following command ignores both the src/b and src/c directories.
cppcheck -isrc/b -isrc/c
@ -138,6 +138,10 @@ You can import and use Cppcheck GUI project files in the command line tool:
The Cppcheck GUI has a few options that are not available in the command line directly. To use these options you can import a GUI project file. We want to keep the command line tool usage simple and limit the options by intention.
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
cppcheck --project=foobar.cppcheck -ifoo
## CMake
Generate a compile database:
@ -148,6 +152,11 @@ The file `compile_commands.json` is created in the current folder. Now run Cppch
cppcheck --project=compile_commands.json
To ignore certain folders you can use `-i`. This will skip analysis of source files in the `foo` folder.
cppcheck --project=compile_commands.json -ifoo
## Visual Studio
You can run Cppcheck on individual project files (\*.vcxproj) or on a whole solution (\*.sln)
@ -162,12 +171,21 @@ Running Cppcheck on a Visual Studio project:
In the `Cppcheck GUI` you have the choice to only analyze a single debug configuration. If you want to use this choice on the command line then create a `Cppcheck GUI` project with this activated and then import the GUI project file on the command line.
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
cppcheck --project=foobar.vcxproj -ifoo
## C++ Builder 6
Running Cppcheck on a C++ Builder 6 project:
cppcheck --project=foobar.bpr
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
cppcheck --project=foobar.bpr -ifoo
## Other
If you can generate a compile database then it's possible to import that in Cppcheck.
@ -182,7 +200,7 @@ You should use a platform configuration that match your target.
By default Cppcheck uses native platform configuration that works well if your code is compiled and executed locally.
Cppcheck has builtin configurations for Unix and Windows targets. You can easily use these with the --platform command line flag.
Cppcheck has builtin configurations for Unix and Windows targets. You can easily use these with the `--platform` command line flag.
You can also create your own custom platform configuration in a XML file. Here is an example: