CMake Arguments

For firmware and unit tests only TOOLCHAIN and ROOT_DIR arguments are mandatory. Other arguments are optional.

For host build, only BUILD_HOST switch is needed.

Firmware & Unit Tests

Mandatory arguments for firmware and unit tests builds.


Specifies toolchain to use, usually it’s prefix to tools that follow GCC naming convention. Toolchain should contain tools like:

  • <prefix>-gcc

  • <prefix>-ar

  • <prefix>-objdump

  • <prefix>-objcopy

There are more tools from GCC-like toolchains that may be used by build system, but these are used in most cases. For example toolchain xtensa-apl-elf, should have tools xtensa-apl-elf-gcc, xtensa-apl-elf-ar, etc. Toolchain has to be in PATH.

# Examples
cmake [...] -DTOOLCHAIN=xt [...]
cmake [...] -DTOOLCHAIN=xtensa-apl-elf [...]
cmake [...] -DTOOLCHAIN=xtensa-cnl-elf [...]

Path to directory with xtensa core’s lib and include.

# Examples
cmake [...] -DROOT_DIR=$CONFIG_PATH/xtensa-elf [...]
cmake [...] -DROOT_DIR=/my-xtensa-newlib/xtensa-root/xtensa-apl-elf [...]


Optional arguments. Only for firmware.


Path to directory with MEU tool. For example full path to MEU that will be used, should be $MEU_PATH/meu or $MEU_PATH/meu.exe.

# Example
cmake [...] -DMEU_PATH=/path/to/meu/installation [...]

Path to file with key that will be used by meu.

# Example
cmake [...] -DMEU_PRIVATE_KEY=/path/to/meu/private-key.pem [...]

Default: /usr/bin/openssl Path to OpenSSL binary used by MEU. Usually you should use it only on Windows.

# Example
cmake [...] -DMEU_OPENSSL=C:/path/to/openssl.exe [...]

Unit Tests

Optional arguments. Only for unit tests.


Default: OFF, if ON then builds unit tests.

# Example: build unit tests instead of firmware

Path to directory with prebuilt Cmocka library. Usually you shouldn’t use it, because if this argument is not used, then CMake will build Cmocka automatically for you in build directory. Cmocka directory should contain include subdirectory with cmocka.h header and lib subdirectory with cmocka-static.a library.

# Example
cmake [...] -DCMOCKA_DIRECTORY=/path/to/cmocka-install-apl [...]

Host Testbench

Optional arguments. Only for host build.


Default: OFF, if ON then builds testbench for host.

# Example: build testbench instead of firmware