How to invoke a static analysis tool using abld

Description

A static analysis tool can be integrated with the Symbian platform build system by using a command line argument to abld. This feature is new in v9.5.

To invoke a static analysis tool, the –wrap option must be passed to abld. For example:

abld build armv5 urel –wrap

The name of the static analysis tool executable is set using the environment variable ABLD_COMPWRAP.

If ABLD_COMPWRAP has not been set, then using the –wrap option causes abld to report an error and terminate. The exception to this is if the –keepgoing option has additionally been used, for instance:

abld build armv5 urel –wrap -keepgoing

In this case abld reports a warning and ignores the –wrap option.

Log file output folders

When invoking abld for multiple platforms and/or build variants (debug and release), the analysis tool may generate multiple log files. In order to avoid log files overwriting each other, they need to be generated in different locations. To do this, pass a target folder as an argument to the static analysis tool that includes the environment variable OUTPUT_NAME. abld will replace OUTPUT_NAME with a platform and build-specific folder name. For example, (the following command line assumes that the target folder is passed to the analysis tool using an argument called emitpath):

set ABLD_COMPWRAP=tool.exe –emitpath c:\analysis\report\$(OUTPUT_NAME)

abld build armv5 –wrap

In this example, the log files for the release build are generated in c:\analysis\report\armv5_urel\ and for the debug build in c:\analysis\report\armv5_udeb\.