Skip to content

Commit b8131a1

Browse files
committed
cmake: define bootloader protect macros
Export WOLFBOOT_ORIGIN and BOOTLOADER_PARTITION_SIZE through WOLFBOOT_DEFS so update_flash/update_ram/update_disk protection code builds under CMake presets.
1 parent 0ab76ea commit b8131a1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,20 @@ if(ARCH STREQUAL "AARCH64")
747747

748748
endif()
749749

750+
if(NOT DEFINED WOLFBOOT_ORIGIN)
751+
set(WOLFBOOT_ORIGIN ${ARCH_FLASH_OFFSET})
752+
endif()
753+
754+
if(NOT DEFINED BOOTLOADER_PARTITION_SIZE)
755+
math(EXPR BOOTLOADER_PARTITION_SIZE
756+
"${WOLFBOOT_PARTITION_BOOT_ADDRESS} - ${ARCH_FLASH_OFFSET}"
757+
OUTPUT_FORMAT HEXADECIMAL)
758+
endif()
759+
750760
list(APPEND WOLFBOOT_DEFS ARCH_FLASH_OFFSET=${ARCH_FLASH_OFFSET})
761+
list(APPEND WOLFBOOT_DEFS
762+
WOLFBOOT_ORIGIN=${WOLFBOOT_ORIGIN}
763+
BOOTLOADER_PARTITION_SIZE=${BOOTLOADER_PARTITION_SIZE})
751764

752765
if(${WOLFBOOT_TARGET} STREQUAL "x86_64_efi")
753766
if(NOT DEFINED GNU_EFI_LIB_PATH)

0 commit comments

Comments
 (0)