-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: Activate ccache #13824
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
CMake: Activate ccache #13824
Conversation
@ladislas, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
find_program(CCACHE ccache)
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(CCACHE)
I found this https://reviews.bitcoinabc.org/D5150?id=15995.
This PR is fine as it is but the other approach looks more future proof.
@0xc0170 I'm happy to change but I'm still not sure which of the two methods is considered best practice. llvm use my approach here: https://github.com/llvm/llvm-project/blob/905f874c449cc114d74eaeb19639664779fd0b6e/llvm/CMakeLists.txt#L153 Same as opencv: https://github.com/opencv/opencv/blob/master/cmake/OpenCVCompilerOptions.cmake#L20 The CMake documentation about RULE_LAUNCH_COMPILE is also interesting: https://cmake.org/cmake/help/latest/prop_gbl/RULE_LAUNCH_COMPILE.html
Regarding your reference and their issue with clang-tidy, it seems that Maybe someone with deep CMake knowledge can shine in on that :) |
Yes, both are fine. I would go with updated version as clang-tidy is something we might revisit in the future so it works in both cases (with and without clang-tidy or something else). |
We update the testing, when you update, please also rebase. |
I'll do the change, rebase, rename the branch and make a new PR. |
Summary of changes
This PR activates ccache for CMake builds as discussed here in #13477
#13477 (comment)
Impact of changes
The changes should speed up the build time by using ccache.
Migration actions required
n/a
Documentation
n/a
Pull request type
Test results
Reviewers
@0xc0170 @hugueskamba