Skip to content

Commit f7661ca

Browse files
authored
Merge pull request #246 from ARMmbed/feature-cmake-api-call-update
CMake: Call mbed_set_post_build API for setting post build operations
2 parents 0089c49 + c421937 commit f7661ca

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.travis.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ language: sh
1818
os: linux
1919
dist: xenial
2020

21+
env:
22+
global:
23+
- PROFILE=develop
24+
2125
cache:
2226
pip: true
2327
ccache: true
@@ -28,8 +32,13 @@ cache:
2832

2933
addons:
3034
apt:
35+
sources:
36+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
37+
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
38+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial-rc main'
3139
packages:
32-
- ninja-build
40+
- cmake
41+
- ninja-build
3342

3443
matrix:
3544
include:
@@ -56,16 +65,22 @@ matrix:
5665
- export PATH="$PATH:${PWD}/gcc-arm-none-eabi-9-2020-q2-update/bin"
5766
- popd
5867
- arm-none-eabi-gcc --version
59-
- pip install --upgrade cmake
68+
# Hide Travis-preinstalled CMake
69+
# The Travis-preinstalled CMake is unfortunately not installed via apt, so we
70+
# can't replace it with an apt-supplied version very easily. Additionally, we
71+
# can't permit the Travis-preinstalled copy to survive, as the Travis default
72+
# path lists the Travis CMake install location ahead of any place where apt
73+
# would install CMake to. Instead of apt removing or upgrading to a new CMake
74+
# version, we must instead delete the Travis copy of CMake.
75+
- sudo rm -rf /usr/local/cmake*
6076
- pip install --upgrade mbed-tools
6177
# Fetch mbed-os: We use manual clone, with depth=1 and --single-branch to save time.
6278
- >-
63-
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
79+
git clone --depth=1 --branch feature-cmake https://github.com/ARMmbed/mbed-os.git;
6480
- >-
65-
mbedtools configure -t GCC_ARM -m ${TARGET_NAME};
66-
mkdir -p build
6781
script:
68-
- cd build && cmake .. -GNinja -DCMAKE_BUILD_TYPE=${PROFILE} && cmake --build .
82+
- echo mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE}
83+
- mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE}
6984
- ccache -s
7085

7186
- <<: *cmake-build-test

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.18.2 FATAL_ERROR)
4+
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
55

6-
# TODO: @mbed-os-tools MBED_ROOT and MBED_CONFIG_PATH should probably come from mbedtools
7-
set(MBED_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
6+
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "")
87
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.mbedbuild CACHE INTERNAL "")
98
set(APP_TARGET mbed-os-example-blinky)
109

11-
include(${MBED_ROOT}/tools/cmake/app.cmake)
10+
include(${MBED_PATH}/tools/cmake/app.cmake)
1211

13-
add_subdirectory(${MBED_ROOT})
12+
add_subdirectory(${MBED_PATH})
1413

1514
add_executable(${APP_TARGET})
1615

@@ -30,7 +29,7 @@ target_link_libraries(${APP_TARGET}
3029
mbed-os
3130
)
3231

33-
mbed_generate_bin_hex(${APP_TARGET})
32+
mbed_set_post_build(${APP_TARGET})
3433

3534
option(VERBOSE_BUILD "Have a verbose build process")
3635
if(VERBOSE_BUILD)

0 commit comments

Comments
 (0)