--add-compiler-options "<option_1> [<option_2>...]" |
-a |
pass additional options to the C/C++ compiler. To pass multiple compiler options, separate them by spaces, and surround the entire string in quotation marks. Acceptable values are Compiler options for kwbuildproject.
Example:
--add-compiler-options "-I C:\Toolbus\lib_includes --print-errors"
If the path you want to specify contains spaces, use a pair of escaped double quotes, for example:
--add-compiler-options "-I \"\"C:\Toolbus\library includes\"\" --print-errors"You must add a space after the end of the last set of escaped double quotes, for example, before the --print-errors option. The space before the first instance of escaped double quotes is included for consistency.
|
--add-linker-options "<option_1> [<option_2>...]" |
-L |
pass additional options to linker. To pass multiple linker options, separate them by spaces, and surround the entire string in quotation marks. Acceptable values are Linker options for kwbuildproject. |
--buildspec-variable <variable_name>= <variable_value> |
-V |
allows the use of a build specification template. When this option is used, and a build specification template (*.tpl) is supplied as input to kwbuildproject instead of a standard build specification, kwbuildproject will substitute all occurrences of a given variable in a build specification template with the specified variable value. See Providing a build specification template for your developers. |
--classic |
|
forces Klocwork to use the previous generation (pre-Klocwork 2018) analysis engine. |
--color |
-c |
enable colored console output |
--dist-host <host_name> |
|
specify the Distributed Analysis Server host (default: localhost) |
--dist-port <int> |
|
set Distributed Analysis Server port (default: 3440) |
--encoding |
-C |
encoding of the source files used in the project. Set this to --encoding UTF-8 if your source files contain multibyte characters (for example, Japanese). Use the --list option of kwconv to find the list of acceptable values.
Notes:
- If you set encoding only at build time and not at the project level, source files containing multibyte characters will not display properly in Klocwork Static Code Analysis's Source Viewer. Setting the encoding with kwbuildproject is useful when the servers are not running. If the servers are running, set source encoding at the project level with the --encoding option of kwadmin create-project or with kwadmin set-project-property, using the source_encoding property.
- If encoding is not set at build time, the encoding set at the project level is used.
- If encoding is not set at the project level, or if it is set but a project is not specified with the --url option of kwbuildproject, the default system encoding is used.
- If encoding is set at both the project level and with kwbuildproject, the kwbuildproject option takes precedence.
|
--errors-config |
-e |
specify problems configuration file |
--force |
-f |
run the analysis even if the tables directory specified with --tables-directory contains data files from the previous analysis run (same code base only). If the analysis is run for different code bases using the same tables, delete the tables before you run the analysis. |
--help |
|
display this help |
--incremental |
-I |
analyze only files changed since the last analysis, as well as any files with dependencies on the changed files. The prerequisite is a previous complete analysis of the full project. You must retain the output tables directory after the analysis run.
Note that you can also use --incremental to resume an interrupted build. This option handles situations in which source files have changed since the analysis stopped.
|
--java-kb <file> |
-K |
use Java knowledge base file |
--jobs-num <int> | auto |
-j |
specify the maximum number of parallel compilation and issue detection processes to run. Specify one of: - an integer from 1 to 64
- auto to set automatic mode. In this mode, the number of compilation jobs will equal the number of available processor cores plus 1. The automatic mode is not supported for distributed analysis. Note that -j auto is the default setting for kwbuildproject.
If you are running a parallel C/C++ or Java analysis on one machine, Klocwork recommends you set this value to the number of available processor cores on the build machine + 1. For example, if you have a dual-core machine, set this value to 3. Above this number, you will likely see a performance degradation. If you are distributing your C/C++ analysis load on multiple machines, Klocwork recommends that you set this value at the number of agents you are running plus 1 (for example, if you are running three agents, specify --jobs-num 4). For more information, see Running a distributed Klocwork C/C++ analysis. Note: Make sure there is enough memory so that no swapping occurs. Reduce the number of jobs if required.
|
--license-host <host_name> |
-H |
set License Server host (default: localhost).
Tip: You can also set this value in the $HOME/.flexlmrc file on UNIX, or the KLOCWORK_LICENSE_FILE environment variable in the Windows registry. This registry entry is found at HKEY_LOCAL_MACHINE > SOFTWARE > FNPlm > License Manager > KLOCWORK_LICENSE_FILE. This will ensure that you do not need to enter these options every time you use kwbuildproject.
|
--license-port <port_number> |
-P |
set License Server port (default: 27000). See Tip for --license-host option. |
--no-color |
|
do not use colored output |
--no-lef |
-n |
do not run the Klocwork issue detection stage |
--project |
-S |
specifies the Klocwork Server project name. You can use this parameter to specify a project you want to download configuration files (such as pconf, metrics_default.mconf) from and apply them during the build. |
--quiet |
-q |
Suppress console messages. Command line parsing errors will not be suppressed. |
--remote |
|
run the engine remotely through Distributed Analysis Server |
--replace-path <original_path>=<new_path> |
|
replace a source path prefix. Possible to use multiple instances of this option in the same command line. Example: --replace-path /usr/include=include. See Replacing the path to your source files. |
--strict |
|
show extra build warnings. This option relates to DO-178B compliance only. When --strict is specified, kwbuildproject will add a line to the build.log file each time it skips the analysis of a function. If kwbuildproject skips one or more functions, the command exits with return code 2. For more information, see C/C++ Path Analysis errors in build log. |
--tables-directory <dir> |
-o |
specifies the location where you want to store the project's tables. Mandatory option. You cannot reuse a tables directory from a previous build unless you also specify one of:
You must have read and write permissions on this directory. Note for Linux: Due to a MySQL limitation, the tables directory path name cannot contain a backslash.
|
--url http://<klocwork_server_host>:<klocwork_server_port>/<server_project> |
|
URL for the project. The arguments identify where the project and the Klocwork Server are located. Use https:// if a secure Klocwork Server connection has been configured. This option synchronizes the configuration, such as checkers, metric and knowledge base settings, located on the server with the specified project. |
--use-fbkb <file> |
-k |
use the specified knowledge base file for C/C++ projects. You can use this option multiple times in one command line. |
--use-prev-fbkb <file> |
-Q |
use the specified knowledge base file as a lower-priority file during a knowledge base update. Records from this file will be added to the new file only if more recent comparable records do not exist. Use this option when you have an automatically generated knowledge base file for a previous version of your source code. This allows you to speed up the issue detection process. However, results will not be as accurate.
A BR tag was used here in the original source. You can specify multiple instances of this option on one command line.
|
--verbose |
-v |
print verbose information about program execution, which can help to troubleshoot errors |
--version |
|
display version information |