Skip to main content

IAR Embedded Workbench for RISC-V 3.40

Introduction to using an external build system

In this section:

Briefly about CMake

CMake is a standard software build system for C/C++ software projects, a format for describing the content and relations of a project.

CMake projects can be added to the Embedded Workbench IDE.

A project that has been imported into the IDE is a reflection of the CMake project—changes to the set of files and options are made in the CMake files. See the documentation for CMake for information on how to configure the project.

IAR Embedded Workbench uses the Ninja build engine to build CMake projects. The installation includes Ninja version 1.10, with custom UTF-8 support, located in the common\bin folder in the Embedded Workbench installation directory. To use another installed version of Ninja, add it to PATH or add -DCMAKE_MAKE_PROGRAM=install_path to the CMake extra options.

Note

A CMake project in the IDE does not have to use an IAR compiler or assembler—the system supports any compiler or assembler, including older versions of the IAR tools. However, using the IAR compiler or assembler version installed with the IDE provides richer debug information and improves the debugging capabilities of the C-SPY Debugger.

Reasons for using an external build system

Adding projects from the CMake build system to the Embedded Workbench IDE allows you to use the familiar Embedded Workbench workflow.

With a CMake project in the IDE, you can use the C-SPY Debugger, C-STAT Static analysis, and C-RUN Runtime error checking, if your license includes those.

Requirements for CMake

Because the IAR Embedded Workbench IDE is just a viewing frame for the CMake project, all changes to files and options must be made in the CMake files. This means that a working knowledge of CMake is required.

For more information about CMake, and for downloading the software, see the CMake website https://cmake.org/.