-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[BUILD] Re-enable ccache by default #12839
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
Changes from 6 commits
fbe81d2
33114f9
841b6b6
9644b40
151346c
d7ba516
a509fb9
dd2bf9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||
| # Licensed to the Apache Software Foundation (ASF) under one | ||||||
| # or more contributor license agreements. See the NOTICE file | ||||||
| # distributed with this work for additional information | ||||||
| # regarding copyright ownership. The ASF licenses this file | ||||||
| # to you under the Apache License, Version 2.0 (the | ||||||
| # "License"); you may not use this file except in compliance | ||||||
| # with the License. You may obtain a copy of the License at | ||||||
| # | ||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||
| # | ||||||
| # Unless required by applicable law or agreed to in writing, | ||||||
| # software distributed under the License is distributed on an | ||||||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||||||
| # KIND, either express or implied. See the License for the | ||||||
| # specific language governing permissions and limitations | ||||||
| # under the License. | ||||||
|
|
||||||
| if(USE_CCACHE) # True for AUTO, ON, /path/to/ccache | ||||||
| if(DEFINED CXX_COMPILER_LAUNCHER OR DEFINED C_COMPILER_LAUNCHER) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also have no idea how cmake works but aren't these vars supposed to have the
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html. It appears to be CXX_COMPILER_LAUNCHER |
||||||
| if("${USE_CCACHE}" STREQUAL "AUTO") | ||||||
| message(STATUS "CXX_COMPILER_LAUNCHER or C_COMPILER_LAUNCHER already defined, not using ccache") | ||||||
| elseif("${USE_CCACHE}" MATCHES ${IS_TRUE_PATTERN}) | ||||||
| message(FATAL_ERROR "CXX_COMPILER_LAUNCHER or C_COMPILER_LAUNCHER is already defined, refusing to override with ccache. Either unset or disable ccache.") | ||||||
| endif() | ||||||
| else() | ||||||
| if("${USE_CCACHE}" STREQUAL "AUTO") # Auto mode | ||||||
| find_program(CCACHE_FOUND "ccache") | ||||||
| if(CCACHE_FOUND) | ||||||
| message(STATUS "Found the path to ccache, enabling ccache") | ||||||
| set(PATH_TO_CCACHE "ccache") | ||||||
| else() | ||||||
| message(STATUS "Didn't find the path to CCACHE, disabling ccache") | ||||||
| endif(CCACHE_FOUND) | ||||||
| elseif("${USE_CCACHE}" MATCHES ${IS_TRUE_PATTERN}) | ||||||
| find_program(CCACHE_FOUND "ccache") | ||||||
| if(CCACHE_FOUND) | ||||||
| message(STATUS "Found the path to ccache, enabling ccache") | ||||||
| set(PATH_TO_CCACHE "ccache") | ||||||
| else() | ||||||
| message(FATAL_ERROR "Cannot find ccache. Set USE_CCACHE mode to AUTO or OFF to build without ccache. USE_CCACHE=" "${USE_CCACHE}") | ||||||
| endif(CCACHE_FOUND) | ||||||
| else() # /path/to/ccache | ||||||
| set(PATH_TO_CCACHE "${USE_CCACHE}") | ||||||
| message(STATUS "Setting ccache path to " "${PATH_TO_CCACHE}") | ||||||
| endif() | ||||||
| # Set the flag for ccache | ||||||
| if(DEFINED PATH_TO_CCACHE) | ||||||
| set(CXX_COMPILER_LAUNCHER "${PATH_TO_CCACHE}") | ||||||
| set(C_COMPILER_LAUNCHER "${PATH_TO_CCACHE}") | ||||||
| endif() | ||||||
| endif() | ||||||
| endif(USE_CCACHE) | ||||||
Uh oh!
There was an error while loading. Please reload this page.