File tree Expand file tree Collapse file tree 6 files changed +84
-0
lines changed
tools/cmake/tests/multiple_executables Expand file tree Collapse file tree 6 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 1+ name : test building multiple executables with CMake
2+
3+ on : [pull_request]
4+
5+ jobs :
6+ multiple-executables-example :
7+ runs-on : ubuntu-latest
8+ container : mbedos/mbed-os-env:latest
9+ steps :
10+ - name : Checkout
11+ uses : actions/checkout@v2
12+
13+ - name : Build the multiple_executables example
14+ run : |
15+ mbedtools compile \
16+ -t GCC_ARM \
17+ -m ARM_MUSCA_S1 \
18+ --program-path tools/cmake/tests/multiple_executables/ \
19+ --mbed-os-path .
20+
21+ - name : Verify the post-build command has run successfully on each image
22+ run : |
23+ APP1=tools/cmake/tests/multiple_executables/cmake_build/ARM_MUSCA_S1/develop/GCC_ARM/app1/app1.bin
24+ APP2=tools/cmake/tests/multiple_executables/cmake_build/ARM_MUSCA_S1/develop/GCC_ARM/app2/app2.bin
25+ BOOTLOADER=targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/bl2.bin
26+ BOOTLOADER_SIZE=`du -b targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/bl2.bin | cut -f1`
27+ cmp -n $BOOTLOADER_SIZE $APP1 $BOOTLOADER
28+ cmp -n $BOOTLOADER_SIZE $APP2 $BOOTLOADER
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2021 Arm Limited. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ cmake_minimum_required (VERSION 3.19.0)
5+
6+ set (MBED_PATH "${CMAKE_CURRENT_SOURCE_DIR} /../../../.." )
7+ set (MBED_CONFIG_PATH "${CMAKE_CURRENT_BINARY_DIR} " )
8+
9+ include ("${MBED_PATH} /tools/cmake/app.cmake" )
10+
11+ project (multiple_executables)
12+
13+ add_subdirectory ("${MBED_PATH} " "mbed-os-build" )
14+
15+ add_subdirectory (app1)
16+ add_subdirectory (app2)
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2021 Arm Limited. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ add_executable (app1 main.cpp)
5+
6+ target_link_libraries (app1 mbed-os)
7+
8+ mbed_set_post_build(app1)
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2021 Arm Limited
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ #include " mbed.h"
7+
8+ int main ()
9+ {
10+ printf (" Application 1\n " );
11+ return 0 ;
12+ }
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2021 Arm Limited. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ add_executable (app2 main.cpp)
5+
6+ target_link_libraries (app2 mbed-os)
7+
8+ mbed_set_post_build(app2)
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2021 Arm Limited
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ #include " mbed.h"
7+
8+ int main ()
9+ {
10+ printf (" Application 2\n " );
11+ return 0 ;
12+ }
You can’t perform that action at this time.
0 commit comments