polyspace.project.BuildConfiguration Class
Namespace: polyspace.project
(Python) External build configurations that can be associated with multiple projects
Since R2026a
Description
The properties of the polyspace.project.BuildConfiguration class contain
build-related configuration options that are saved separately from a Polyspace® Platform project in a .pscfg external configuration file.
Saving your build configurations in .pscfg files and referencing those
files from one or more projects enables you to create a modular project structure that
improves sharing and version control workflows.
To work with external build configurations, use this class, which contains the build
configuration, together with the polyspace.project.BuildConfigurationRef class, which contains the name of the
external build configuration and the path to the .pscfg file where it is
saved. The properties of this class correspond to the build options listed in Polyspace Test
options, Polyspace Bug Finder
options (Polyspace Bug Finder), and Polyspace Code Prover
options (Polyspace Code Prover).
To create and manage build configurations that are owned by a specific project, use the
polyspace.project.OwnedBuildConfiguration class.
Creation
Description
externalConfig = myBuildConfigurationRefObj.get() returns the
polyspace.project.BuildConfiguration object referenced by the
polyspace.project.BuildConfigurationRef object
myBuildConfigurationRefObj. For more information on managing external
configurations referenced by the project, see polyspace.project.BuildConfigurationRef.
Properties
Relative or absolute path to the .pscfg configuration file where
the external build configuration is saved. This file is referenced by the project and
managed using the polyspace.project.BuildConfigurationRef class. Relative paths are considered
relative to the location of the .psprjx project file. This property
is read-only.
Example: "configs/myBuildConfig.pscfg"
Optional description of the build configuration. Use this property to provide information about the build configuration.
Example: "My build configuration"
Specify that your compiler implements right shifts on signed integers as arithmetic shifts.
See also Shift right on signed integers as arithmetic shift (-logical-signed-right-shift) (Polyspace Bug Finder).
Example: buildConf.ArithmeticSignedIntegerRightShift=False
Specify the name of the target board Polyspace Test™ uses to run the test executable.
See also Target
board name (Testing).
Example: buildConf.Board="myBoard"
Specify C standard version followed in code, as a buildConf.CVersion value.
See also C standard version (-c-version).
Example: buildConf.CVersion=buildConf.CVersion.C_17
Specify C++ standard version followed in code, as a buildConf.CppVersion value.
See also C++ standard version (-cpp-version)
Example: buildConf.CppVersion=buildConf.CppVersion.CPP_17
Emulate your compiler behavior by replacing macros with their definitions in preprocessed code. Specify the macro definition as macroName=macroDefinition. To ignore a macro, set it equal to blank (macroName=). To replace a macro by 1, specify only macroName.
To modify this property, use these methods:
append(— Add a macro definition.macroDefinition)pop(— Remove the macro definition with indexmacroDefinitionIdx)macroDefinitionIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all macro definitions.
See also Preprocessor definitions (-D).
Example: buildConf.Defines.append("uint32=int")
Example: buildConf.Defines.append("NDEBUG")
Example: buildConf.Defines.pop(0)
Enable or disable the compilation of code on your host machine while retaining the word sizes of target processor on which the code is intended to run.
See also Enable portable word sizes
Example: buildConf.EnablePortableWordSizes=True
Specify paths of headers and precompiled libraries for tests that you import from an external framework such as GoogleTest.
Specify path of folders where Polyspace Test looks for headers files included in external tests.
To modify this property, use these methods:
add(— Add an include path.folderPath)pop(— Remove the include path with indexfolderPathIdx)folderPathIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all macro definitions.
See also Include paths for external tests.
Example: buildConf.ExternalTestsBuildOptions.IncludePaths.add("/usr/lib/import")
Example: buildConf.ExternalTestsBuildOptions.IncludePaths.pop(0)
Specify the name of the precompile objects, static libraries, or dynamic libraries that Polyspace Test links with your source files and test code to build test executables for external tests.
To modify this property, use these methods:
append(— Add a value to this property.libraryName)pop(— Remove the value with indexlibraryNameIdx)libraryNameIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
See also Libraries for external tests.
Example: buildConf.ExternalTestsBuildOptions.Libraries.append("libgtest.a")
Example: buildConf.ExternalTestsBuildOptions.Libraries.pop(0)
Specify the path of the folders where Polyspace Test looks for precompiled objects, static libraries, or dynamic libraries that you specify with buildConf.ExternalTestsBuildOptions.Libraries.
To modify this property, use these methods:
append(— Add a value to this property.folderPath)pop(— Remove the value with indexfolderPathIdx)folderPathIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
See also Library paths for external tests.
Example: buildConf.ExternalTestsBuildOptions.LibraryPaths.append("/usr/local/googletest/build/lib/")
Example: buildConf.ExternalTestsBuildOptions.LibraryPaths.pop(0)
Specify additional C compilation flags that your compiler needs to build your C code project correctly. Use this option for flags that you cannot specify through other options.
See also Extra C flags.
Example: buildConf.ExtraCFlags="-ffast-math"
Specify additional C++ compilation flags that your compiler needs to build your C++ code project correctly. Use this option for flags that you cannot specify through other options.
See also Extra C++ flags.
Example: buildConf.ExtraCppFlags="-fno-rtti"
Specify additional linker flags that your compiler needs to build your C or C++ code project correctly. Use this option for flags that you cannot specify through other options.
See also Extra flags for linking.
Example: buildConf.ExtraLinkFlags="-pthread"
Specify build options that you want to associate with a specific file without applying those options to other files in your project.
Use add( to associate file
filePath)filePath with a
polyspace.project.FileBuildOptions object or
addChecked( to add
the file only if filePath)filePath has already been declared in
the project. To remove the polyspace.project.FileBuildOptions
object associated with filePath, use
pop(. To remove all
filePath)polyspace.project.FileBuildOptions objects, use
clear().
To change the properties of an existing polyspace.project.FileBuildOptions object, use square brackets to select the corresponding source file. For example, buildConf.FileOverrides[".filePath"]
The polyspace.project.FileBuildOptions object stores these file-specific options:
CVersionCppVersionDefinesExtraFlagsImplicitCompilerDefinesImplicitCompilerIncludePathsIncludePathsLanguagePreIncludesUndefines
See also -options-for-sources (Polyspace Bug Finder).
Example: buildConf.FileOverrides.add("filePath")
Example: buildConf.FileOverrides["filePath"].Language=polyspace.project.FileLanguage.CPP
Example: buildConf.FileOverrides["filePath"].CppVersion=buildConf.CppVersion.CPP_17
Example: buildConf.FileOverrides.pop("filePath")
Specify the path of folders where Polyspace Test looks for files that are included by your source and test code. You can specify the absolute path or the path relative to the current folder.
To modify this property, use these methods:
add(— Add a folder path.folderPath)pop(— Remove the folder path with indexfolderPathIdx)folderPathIdx. If you do not specify an index, the last folder path in the list is removed.clear()— Remove all folder paths associated with this property.
See also Include paths (-I).
Example: buildConf.IncludePaths.add("/usr/local/polyspace/pstunit")
Example: buildConf.IncludePaths.pop(0)
Specify how your compiler rounds down the results of a negative integer division if your compiler follows the C90 Standard. By default, the quotient is rounded toward zero, or the smallest integer greater than or equal to the algebraic quotient. For example, -5/3 = -1. Specify Floor to round the quotient to the largest integer less than or equal to the algebraic quotient. For example, -5/3 = -2.
See also Round down results of negative integer division (-div-round-down) (Polyspace Bug Finder).
Example: buildConf.IntegerDivisionRounding=buildConf.IntegerDivisionRounding.Floor
Specify the language of your source files. Polyspace Test uses the language conventions of the language that you specify. Some options are available only if you select C as the language, and some options are available only if you select C++ as the language.
Select C_CPP if your project contains both C and C++ files. In this case, Polyspace interprets .c files as C code and other file extensions as C++ code.
See also Source code language (-lang).
Example: buildConf.Language=buildConf.Language.C_CPP
Specify the name of the precompile objects, static libraries, or dynamic libraries that Polyspace Test links with your source files and test code to build test executables.
To modify this property, use these methods:
append(— Add a value to this property.libraryName)pop(— Remove the value with indexlibraryNameIdx)libraryNameIdx. If you do not specify an index, the last value in the list is removed.clear()— Remove all values associated with this property.
See also Libraries.
Example: buildConf.Libraries.append("mylib.so")
Example: buildConf.Libraries.pop(0)
Specify the path of the folders where Polyspace Test looks for precompiled objects, static libraries, or dynamic libraries that you specify with buildConf.Libraries.
To modify this property, use these methods:
append(— Add a folder path.folderPath)pop(— Remove the folder path with indexfolderPathIdx)folderPathIdx. If you do not specify an index, the last folder path in the list is removed.clear()— Remove all folder paths associated with this property.
See also Library paths.
Example: buildConf.LibraryPaths.append("/usr/local/build/lib/")
Example: buildConf.LibraryPaths.pop(0)
Specify the default packing alignment, in bytes, for structures, unions, and class members.
Example: buildConf.PackAlignmentValue=buildConf.PackAlignmentValue.SIZE_4_B
Specify files to be included by every source file. Specifying this property does not modify the original source files. For example, set this property to define types that are not defined in your code.
To modify this property, use these methods:
append(— Add a file path.filePath)pop(— Remove the file path with indexfilePathIdx)filePathIdx. If you do not specify an index, the last file path in the list is removed.clear()— Remove all file paths associated with this property.
See also Forced includes (-include).
Example: buildConf.PreIncludes.append("/usr/lib/types/mytypes.h")
Example: buildConf.PreIncludes.pop(0)
Select or manage the processor for the current build configuration. To view a list of available processors for a project proj, type proj.Processors.
Note that if you set the Board property to the name of a previously registered hardware board (that is, a value other than "None" or "Host Computer"), the Processor property is set to the processor associated with the board. For an example of setting a hardware board, see Add Target and Build Tests on Target.
You can view or modify these processor properties. Depending on the processor you select, you can modify only some properties.
See also Processor.
Example: buildConf.Processor=proj.Processors[2]
Processor properties
Maximum alignment of integer types.
Example: buildConf.Processor.Alignment=16
Size of char data type in bits.
Example: buildConf.Processor.CharBitsSize=8
Size of double data type in bits.
Example: buildConf.Processor.DoubleBitsSize=16
Byte ordering for custom processors. The byte ordering determines how multibyte data types are arranged in memory.
Example: buildConf.Processor.Endianess=buildConf.Processor.Endianess.Big
Underlying type for enum:
DEFINED_BY_COMPILER— Polyspace usessigned intas the underlying type ofenumsfor all compilers exceptgnu,clang, andtasking.For the
gnuandclangcompilers, Polyspace uses the first type that can hold all of the enumerator values from this list:unsigned int,signed int,unsigned long,signed long,unsigned long long, andsigned long long.For the tasking compiler, Polyspace uses the first type that can hold all of the enumerator values from this list:
char,unsigned char,short,unsigned short,int, andunsigned int.AUTO_SIGNED_FIRST— Polyspace uses the first type that can hold all of the enumerator values from this list:signed char,unsigned char,signed short,unsigned short,signed int,unsigned int,signed long,unsigned long,signed long long, andunsigned long long.AUTO_UNSIGNED_FIRST— Polyspace uses the first type that can hold all of the enumerator values from this list:For positive enumerator values:
unsigned char,unsigned short,unsigned int,unsigned long, andunsigned long long.For negative enumerator values:
signed char,signed short,signed int,signed long, andsigned long long.
Example: buildConf.Processor.EnumTypeDefinition=buildConf.Processor.EnumTypeDefinition.AUTO_SIGNED_FIRST
Size of float data type in bits.
Example: buildConf.Processor.FloatBitsSize=16
Size of int data type in bits.
Example: buildConf.Processor.IntBitsSize=8
Support for long long data type.
Example: buildConf.Processor.IsLongLongSupported=True
Size of long data type in bits.
Example: buildConf.Processor.LongBitsSize=32
Size of long double data type in bits.
Example: buildConf.Processor.LongDoubleBitsSize=32
Size of long long data type in bits.
Example: buildConf.Processor.LongLongBitsSize=64
Size of pointer in bits.
Example: buildConf.Processor.PointerBitsSize=8
Underlying type of ptrdiff_t data type.
Example: buildConf.Processor.PtrDiffT=buildConf.Processor.PtrDiffT.INT
Size of short data type in bits.
Example: buildConf.Processor.ShortBitsSize=8
Specify whether plain char types are signed or not.
Example: buildConf.Processor.SignedChar=True
Underlying type of size_t data type.
Example: buildConf.Processor.SizeT=buildConf.Processor.SizeT.UNSIGNED_INT
Minimum value of alignment for struct and union data types
Example: buildConf.Processor.StructureMinAlignment=8
Underlying type of wchar_t data type.
Example: buildConf.Processor.WCharT=buildConf.Processor.WCharT.UNSIGNED_INT
Number of bits that the processor can process at one time.
Example: buildConf.Processor.WordSize=64
Size of special function registers (sfr) data types, specified in bits as typename=sizeInBits.
To modify this property, use these methods:
append(— Add a value to this property.typename=sizeInBits)pop(— Remove the value with indextypenameIdx)typenameIdx. If you do not specify an index, the last value in the list is removed.clear()— Remove all values associated with this property.
See also Sfr type support (-sfr-types) (Polyspace Bug Finder)
Example: buildConf.SfrTypes.append("sfr32=32")
Example: buildConf.SfrTypes.pop(0)
Name of compiler that Polyspace uses to build your source code for static analysis (Bug Finder or Code Prover analysis). For a list of available compilers, see Compilation toolchain (Static Analysis) (Polyspace Bug Finder).
Example: buildConf.StaticAnalysisCompilerName="gnu9.x"
Name of processor target whose fundamental data type sizes Polyspace uses to build your source code for static analysis (Bug Finder and Code Prover). For a list of available targets, see Target processor type (-target) (Polyspace Bug Finder).
Example: buildConf.StaticAnalysisTargetName="x86_64"
Compiler that Polyspace uses to build your source code and tests for dynamic testing. By default. Polyspace automatically detects an installed toolchain. If you specify a different compilation toolchain, check that the compiler is installed on your system.
See also Compilation toolchain (Testing).
Example: buildConf.Toolchain="GNU gcc/g++ | CMake/Ninja (64-bit Linux)"
Emulate your compiler behavior by declaring macros as undefined in preprocessed code.
To modify this property, use these methods:
append(— Add a macro to this property.macroName)pop(— Remove the macro with indexmacroNameIdx)macroNameIdx. If you do not specify an index, the last macro in the list is removed.clear()— Remove all macros associated with this property.
This property has no effect on macros that you define using a #define preprocessor directive.
See also Disabled preprocessor definitions (-U).
Example: buildConf.Undefines.append("_WIN32")
Example: buildConf.Undefines.pop(0)
Methods
save() | Save changes to the referenced Example:
|
saveCopy() | Save a copy of the external build configuration file with a new name or in a new location. Example:
|
close() | Close the referenced external build configuration and unload it from memory. The object, methods, and properties become stale after you unload the external configuration. Example:
|
Version History
Introduced in R2026a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)