Skip to main content

IAR Embedded Workbench for Arm 10.10.x

iarbuild—the IAR Command Line Build Utility

In this section:

The IAR Command Line Build Utility (iarbuild) is located in the common\bin directory.

The invocation syntax is one of:

iarbuild project.ewp [opmode] {config[,config2,...]|"*"} [options]
iarbuild -E utility options

The first alternative builds your project. The second alternative performs an operation on your project using an external utility.

Using iarbuild

These are the possible parameters for iarbuild:

Parameter

Description

project.ewp

Your IAR Embedded Workbench project file.

opmode

One of these operating modes (see descriptions below the table):

-build

-clean

-compdb

-cspybat_cmds

-cstat_checks

-cstat_clean

-cstat_cmds

-cstat_config

-cstat_report

-jsondb

-launch_json

-make (default)

-ninja

utility

Operates by invoking an external utility (see descriptions below the table). Choose between:

clangd_compile_commands

cstat_analyze

config|"*"

config, the name of a configuration you want to build, either one of the predefined configurations Debug or Release or a name that you define yourself. For more information, see Projects and build configurations.

* (wild card character), the operation mode commands will process all configurations defined in the project. (The quote characters can be omitted under Microsoft Windows.)

options

One or more of these additional options (see descriptions below the table):

-cstat_config_file filename

-fail_fast

-log type

-output filename

-output_type filetype

-parallel number

-tool type

-varfile filename

Table 4. iarbuild command line options 


If you run the application from a command shell without specifying a project file, you will get a sign-on message describing available parameters and their syntax.

If the operation was successful, the IAR Command Line Build Utility returns 0. Otherwise it returns a non-zero number and a diagnostic message.

Using iarbuild to run C-STAT

For general information on the C-STAT Static Analysis tool and how to use it, see C-STAT® for static analysis.

If you have a project that is not based on an Embedded Workbench project file (.ewp), you can use the IAR Command Line Build Utility (iarbuild) together with a JSON compilation database of the project to perform a C-STAT analysis, either by pointing to a CMake build directory to create the JSON file, or by pointing to an existing JSON compilation database file.

The invocation syntax is:

iarbuild -E cstat_analyze options

These are the possible parameters:

Parameter

Description

options

One or more of these options (see descriptions below the table):

--build_dir directory

--compile_commands filename

--configuration|-c configname

--cstat_config_file filename

--generate_report project

--output_dir|-o filename

--sarif

Table 5. iarbuild command line C-STAT options