Main Content

Additional include paths (-I)

Specify build-specific include paths in addition to project-wide include paths

Since R2024a

Description

The option with this name is available only in the Polyspace Platform (Polyspace Test) user interface. In the standard Polyspace® user interface, you add include paths during project creation. For more information, see Add Source Files for Analysis in Polyspace User Interface.

Polyspace looks in the specified folders for header files included with #include statements in sources, in addition to or instead of the folders specified for the option Include paths (Polyspace Test).

This option is equivalent to the command-line command -I. This option applies to both static analysis and dynamic testing. You can specify either an absolute path to the header files or a path relative to the project location.

Set Option

User interface (Polyspace Platform, desktop products only): In your project configuration, the option is in the Build tab.

Command line and options file: Use the command -I. See Command-Line Information.

Why Use This Option

Use this option to specify include paths specific to a particular variant of a build configuration. In other words, if you need to add an include path only for a specific build but must not add the path for all builds, specify that path using the option Additional include paths. Otherwise, use the option Include paths (-I) (Polyspace Test).

For more information on configuration variants, see Configure Project for Static Analysis in Polyspace Platform User Interface.

Settings

Specify the absolute or relative path to the folders that contains your header files. To add a folder, do one of the following:

  • Click and enter the path to the folder containing your header files. Polyspace resolves the relative paths relative to the location of the project file (*.psprjx).

  • Browse to the location by using the Add folder () or Add folder as relative path () button.

If you want to include the subfolders of the specified folder recursively, select the checkbox in the Subfolders column.

Below the Additional include paths option, you see a dropdown with the option Append to project include paths chosen. This indicates that the additional include paths are appended to the project-wide include paths by default. Project-wide include paths are the include paths specified for the option Include paths (Polyspace Test). You can also choose one of these options from the dropdown :

  • Prepend to project include paths

  • Replace project include paths

During static analysis or project build, the include paths are used for header file lookup in the order in which you add them. As a result, if a header file with a specific name exists in multiple locations, the file in the location added earlier gets used during project build or static analysis. In particular, if a header file exists both in a build-specific include path and a project-wide include path, and build-specific paths are appended to project-wide paths, the header file in the project-wide path gets used.

Tips

You can use project variables or system environment variables as shorthands in the include folder paths. If you share the project with another user who has the include folders in a different root location, utilizing environment variables can help ensure that the project stays in sync with include folder paths. For more information, see:

Command-Line Information

To use this option at the command line, you can either use the option directly or append the option in an options file.

Parameter: -I
Default: None
Value: file (Use -I multiple times for multiple files)
Example (Bug Finder): polyspace-bug-finder -I /com1/inc -I /com1/sys/inc
Example (Code Prover): polyspace-code-prover -I /com1/inc -I /com1/sys/inc
Example (Bug Finder Server): polyspace-bug-finder-server -I /com1/inc -I /com1/sys/inc
Example (Code Prover Server): polyspace-code-prover-server -I /com1/inc -I /com1/sys/inc

Version History

Introduced in R2024a