-
Notifications
You must be signed in to change notification settings - Fork 16
Using Ninja Multi‐Config
Felipe Torrezan edited this page Jan 28, 2024
·
2 revisions
CMake offers a special build system generator for ninja named Ninja Multi-Config
capable of generating build scripts for all its default build types.
- When configuring a CMake project, use the
Ninja Multi-Config
generator:
cmake -Bbuild -G "Ninja Multi-Config" --toolchain /path/to/your-iar-toolchain-file.cmake
- Build each build configuration
cmake --build build --config Debug
cmake --build build --config Release
cmake --build build --config RelWithDebInfo
By default, CMake does not include MinSizeRel
in CMAKE_CONFIGURATION_TYPES
for the "Ninja Multi-Config" generator.
If you are interested in obtaining the binary with the minimal size generated by the IAR compiler:
- Append
MinSizeRel
to theCMAKE_CONFIGURATION_TYPES
right before you define yourproject()
list(APPEND CMAKE_CONFIGURATION_TYPES MinSizeRel)
- Configure the build system as described earlier
cmake -Bbuild -G "Ninja Multi-Config" --toolchain /path/to/your-iar-toolchain-file.cmake
- Build for minimal binary size
cmake --build build --config MinSizeRel
This is the cmake-tutorial wiki. Back to Wiki Home
- Setting language-specific target options
- Selecting build types
- Using Ninja Multi-Config
- Filing a build log
- Multi-file compilation
- Invoking IAR binary utilities