Skip to content

Commit 7e60170

Browse files
Sudarshan SreeramLDong-Arm
andcommitted
Add support for cmake build workflow
A missing include was added into main.cpp to fix the build. Co-authored-by: Lingkai Dong <[email protected]>
1 parent c42a25e commit 7e60170

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Mbed-MCUboot Demo Application
5+
6+
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
7+
8+
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
9+
set(MCUBOOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mcuboot CACHE INTERNAL "")
10+
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
11+
set(APP_TARGET application)
12+
13+
include(${MBED_PATH}/tools/cmake/app.cmake)
14+
15+
project(${APP_TARGET})
16+
17+
add_subdirectory(${MBED_PATH})
18+
add_subdirectory(${MCUBOOT_PATH}/boot/bootutil/)
19+
add_subdirectory(${MCUBOOT_PATH}/boot/mbed/) # Mbed-MCUboot Port
20+
21+
add_executable(${APP_TARGET})
22+
23+
target_sources(${APP_TARGET}
24+
PUBLIC
25+
main.cpp
26+
)
27+
28+
target_link_libraries(${APP_TARGET}
29+
PUBLIC
30+
bootutil
31+
mbed-mcuboot
32+
mbed-storage
33+
mbed-os
34+
)
35+
36+
mbed_set_post_build(${APP_TARGET})
37+
38+
option(VERBOSE_BUILD "Have a verbose build process")
39+
if(VERBOSE_BUILD)
40+
set(CMAKE_VERBOSE_MAKEFILE ON)
41+
endif()

main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "bootutil/bootutil.h"
1010
#include "bootutil/image.h"
1111
#include "FlashIAP/FlashIAPBlockDevice.h"
12+
#include "blockdevice/SlicingBlockDevice.h"
1213
#include "drivers/InterruptIn.h"
1314

1415
#define TRACE_GROUP "main"

0 commit comments

Comments
 (0)