From 006819ec3637087f38a9bd0fd7ac4e73765f4eca Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Wed, 4 Nov 2020 13:56:44 +0000 Subject: [PATCH 1/4] CMake: Call mbed_set_post_build API for setting post build operations --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c587fc9..ca846d24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ target_link_libraries(${APP_TARGET} mbed-os ) -mbed_generate_bin_hex(${APP_TARGET}) +mbed_set_post_build(${APP_TARGET}) option(VERBOSE_BUILD "Have a verbose build process") if(VERBOSE_BUILD) From 54a3073d2683505c8b5d8f7b0fe3b9131f2f3ede Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Thu, 5 Nov 2020 10:27:10 +0000 Subject: [PATCH 2/4] Update travis to call mbedtools with build commandline argument to avoid configure step - Update CMake minimum version required from 3.18.2 to 3.19.0 - Replace mbed-os source path MBED_ROOT with MBED_PATH in CMakeLists.txt --- .travis.yml | 4 +--- CMakeLists.txt | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f9885d7..7f7981e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,10 +62,8 @@ matrix: - >- git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git; - >- - mbedtools configure -t GCC_ARM -m ${TARGET_NAME}; - mkdir -p build script: - - cd build && cmake .. -GNinja -DCMAKE_BUILD_TYPE=${PROFILE} && cmake --build . + - mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE} - ccache -s - <<: *cmake-build-test diff --git a/CMakeLists.txt b/CMakeLists.txt index ca846d24..917b9597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,16 +1,15 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.18.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR) -# TODO: @mbed-os-tools MBED_ROOT and MBED_CONFIG_PATH should probably come from mbedtools -set(MBED_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.mbedbuild CACHE INTERNAL "") set(APP_TARGET mbed-os-example-blinky) -include(${MBED_ROOT}/tools/cmake/app.cmake) +include(${MBED_PATH}/tools/cmake/app.cmake) -add_subdirectory(${MBED_ROOT}) +add_subdirectory(${MBED_PATH}) add_executable(${APP_TARGET}) From f58afd23bc9e44704c0cb1e11002d654d103496c Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 5 Nov 2020 15:11:03 +0000 Subject: [PATCH 3/4] travis: Get CMake from kitware repo This ensures that the latest version release is downloaded. --- .travis.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f7981e8..e186939b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,10 @@ language: sh os: linux dist: xenial +env: + global: + - PROFILE=develop + cache: pip: true ccache: true @@ -28,8 +32,13 @@ cache: addons: apt: + sources: + - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main' + key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc' + - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial-rc main' packages: - - ninja-build + - cmake + - ninja-build matrix: include: @@ -56,13 +65,21 @@ matrix: - export PATH="$PATH:${PWD}/gcc-arm-none-eabi-9-2020-q2-update/bin" - popd - arm-none-eabi-gcc --version - - pip install --upgrade cmake + # Hide Travis-preinstalled CMake + # The Travis-preinstalled CMake is unfortunately not installed via apt, so we + # can't replace it with an apt-supplied version very easily. Additionally, we + # can't permit the Travis-preinstalled copy to survive, as the Travis default + # path lists the Travis CMake install location ahead of any place where apt + # would install CMake to. Instead of apt removing or upgrading to a new CMake + # version, we must instead delete the Travis copy of CMake. + - sudo rm -rf /usr/local/cmake* - pip install --upgrade mbed-tools # Fetch mbed-os: We use manual clone, with depth=1 and --single-branch to save time. - >- git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git; - >- script: + - echo mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE} - mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE} - ccache -s From c421937b348a18b327122a93d5b1556127d596fa Mon Sep 17 00:00:00 2001 From: Rajkumar Kanagaraj Date: Thu, 5 Nov 2020 16:23:34 +0000 Subject: [PATCH 4/4] Update git clone to checkout specific branch after clone --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e186939b..42feb438 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,7 +76,7 @@ matrix: - pip install --upgrade mbed-tools # Fetch mbed-os: We use manual clone, with depth=1 and --single-branch to save time. - >- - git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git; + git clone --depth=1 --branch feature-cmake https://github.com/ARMmbed/mbed-os.git; - >- script: - echo mbedtools build -t GCC_ARM -m ${TARGET_NAME} -b ${PROFILE}