Working with multiple toolchain versions - IARSystems/cmake-tutorial GitHub Wiki
Introduction
When multiple toolchain versions are used with the same CMake project, the following method can be used.
Applies to
- CMake projects using multiple versions of the IAR C/C++ Compilers.
Tasks
- Create one
<your-iar-toolchain-file>.cmake
per toolchain, each one with its appropriate settings. Example:
bxarm-9.50.1.cmake
bxarm-8.50.6.cmake
- When configuring the CMake project, use
-B
to select which build directory will be used for each toolchain. Example, when executing from the project's top directory:
cmake -G Ninja -Bbuild-9.50.1 --toolchain /path/to/bxarm-9.50.1.cmake
cmake -G Ninja -Bbuild-8.50.6 --toolchain /path/to/bxarm-8.50.6.cmake
- Build each output individually
cmake --build build-9.50.1
cmake --build build-8.50.6