Information Gathered From Build Systems for Polyspace Analysis and Testing
If you use a build command such as make or cmake for building your source code or you are able to generate a JSON compilation database using your build system, you can create a Polyspace® Platform project by tracing the build command or compilation database. You can keep the project in sync with the latest sources and build information by retracing the build command as needed.
Information Extracted from Build Command when Creating or Updating Polyspace Platform Project
Creating or updating a Polyspace Platform project from your build command extracts the following information from your build command into the project:
Adds required source files to your project.
If your build command builds tests authored using the Polyspace Test™ xUnit API or a supported external testing framework, the test files are automatically separated from the source files in the generated project. For an example, see Create Polyspace Platform Projects from Builds That Use Makefiles.
Sets the project language and language standard. For more information, see
Source code language (-lang).Adds include paths and macro definitions that are part of your application build command. See:
If your build command compiles different files with different options, the file-specific options are added to the project and taken into account for static analysis. When you build a project for testing, these options are however concatenated into a global list of options which is used to build all files.
To see the options associated with a file:
Open your project configuration.
Select Target & Compiler > File Specific Options.
Select the file that you want from the drop-down list of files.
Sets additional flags that are part of the build command. See:
Extra C flags(Polyspace Test)Extra C++ flags(Polyspace Test)Extra flags for linking(Polyspace Test) (only for GCC, Clang and Microsoft® Visual Studio® linkers)
Sets libraries and library paths. See
Libraries(Polyspace Test) andLibrary paths(Polyspace Test).Adds include paths and macro definitions that are implicitly defined by your compiler.
Sets the compiler for static analysis with Polyspace Bug Finder™ or Polyspace Code Prover™. For more information, see
Compilation toolchain (Static Analysis).Sets the compiler for dynamic testing with Polyspace Test. See
Compilation toolchain (Testing)(Polyspace Test).Sets processor information such as sizes of types, underlying types of
size_t, and so on. For more information, seeProcessor.
Information Retained when Updating Polyspace Platform Project
You can update a project created from a build command to stay in sync with your latest sources and build information. During an update:
Source and test files, include paths, and build configuration options that are created from the build command are updated.
All previous options in the build configuration are removed and populated using the current build command. In particular, if you created a project from a build command and later modified some options, your modifications are lost during the project update. You can retain your modifications by duplicating the build configuration, and following an update, copying back the modifications from the duplicated configuration variant. For more information on configuration variants, see Configure Project for Static Analysis in Polyspace Platform User Interface.
Except the build configuration options, any information you entered explicitly is retained in the project. In particular, any source file, test file, or project include path you added explicitly is retained.
All existing file and folder exclusions are removed. See
Exclude patterns.
When retracing your build command, make sure to perform a full build or your system instead of an incremental build. Tracing an incremental build causes your project to lose any source, test, or build configuration option that are not included in the incremental build.