Skip to content

CMake: Activate ccache #13834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2020
Merged

Conversation

ladislas
Copy link
Contributor

@ladislas ladislas commented Oct 30, 2020

Summary of changes

This PR activates ccache for CMake builds as discussed here in #13477.

#13477 (comment)

It replaces #13824

It also changes the Travis config for ccache to follow Travis' guidelines

https://docs.travis-ci.com/user/caching/#ccache-cache

This part can be removed if needed.

Impact of changes

Faster build time for users and for CI.

Migration actions required

n/a

Documentation

Documentation should tell users to install ccache on their computer or CI system to benefit from the change.


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@0xc0170 @hugueskamba @rajkan01


@ladislas ladislas changed the title Activate ccache for CMake CMake: Activate ccache Oct 30, 2020
@ciarmcom ciarmcom requested review from 0xc0170, hugueskamba, rajkan01 and a team October 30, 2020 10:00
@ciarmcom
Copy link
Member

@ladislas, thank you for your changes.
@hugueskamba @rajkan01 @0xc0170 @ARMmbed/mbed-os-maintainers please review.

@@ -1,6 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

find_program(CCACHE "ccache")
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignment fix here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've replace the tab with 4 spaces.

What about adding an .editorconfig to make sure these kinds of styles respected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding an .editorconfig to make sure these kinds of styles respected?

could be. We use astyle currently (not yet checking CMake files, might not even be able to)

Copy link
Contributor Author

@ladislas ladislas Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also wondering how we could check CMake files for our project, https://github.com/cheshirekow/cmake_format is a good candidate.

With .editorconfig, you "don't check anything", you just define the style. You then install the plugin in your favorite editor and it will use the style you've setup in your config file.

https://editorconfig.org/

It can be extension based or even file based if needed.

Quick example: https://github.com/ladislas/mbed-cmake-template/blob/master/.editorconfig

I can make a PR to master to start a conversation and discuss the style definition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets create an issue, and we can review.

@ladislas ladislas force-pushed the feature-cmake-ccache branch from 66ca613 to 44da292 Compare October 30, 2020 10:35
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Oct 30, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@0xc0170 0xc0170 merged commit 9dcc3b1 into ARMmbed:feature-cmake Nov 2, 2020
@mergify mergify bot removed the ready for merge label Nov 2, 2020
@ladislas ladislas deleted the feature-cmake-ccache branch November 2, 2020 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants