Build: Introduce MCUBOOT_IMAGE_NUMBER switch
Add the MCUBOOT_IMAGE_NUMBER compile time switch to the build system to
be able to specify the number of separately updatable firmware images.
It can be set in the MCUBootConfig.cmake configuration file or include
this macro definition in the command line at build time.
Change-Id: Iefe26e2029ce68352ec2ed6c0d7b2b086e2afec0
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index a1cd01d..58cabd1 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -258,6 +258,9 @@
endif()
if (BL2)
+ # Add MCUBOOT_IMAGE_NUMBER definition to the compiler command line.
+ add_definitions(-DMCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER})
+
if (${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "NO_SWAP")
set(LINK_TO_BOTH_MEMORY_REGION ON)
endif()