-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to use public ccache rahter than RDI ccache (#8599)
While not as efficient as rdi ccache, the public version can be used by everyone. Requires that ccache is installed on system. Signed-off-by: Soren Soe <[email protected]>
- Loading branch information
Showing
2 changed files
with
15 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved. | ||
# | ||
if (RDI_CCACHE) | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. | ||
if (XRT_CCACHE) | ||
|
||
find_program(CCACHE_PROGRAM ccache) | ||
|
||
find_program(gccwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccwrap) | ||
find_program(gccarwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccarwrap) | ||
if(CCACHE_PROGRAM) | ||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
|
||
if (gccwrap) | ||
message ("-- Using compile cache wrapper ${gccwrap} with cache in $ENV{RDI_CCACHEROOT}") | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${gccwrap} --with-cache-rw") | ||
endif () | ||
|
||
if (gccarwrap) | ||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>") | ||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>") | ||
set(CMAKE_CXX_ARCHIVE_FINISH) | ||
set(CMAKE_C_ARCHIVE_FINISH) | ||
message ("-- Using link cache wrapper ${gccarwrap} with cache in $ENV{RDI_CCACHEROOT}") | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${gccarwrap} --with-cache-rw") | ||
endif () | ||
|
||
# Disable abi compile time checks which renders ccache close to useless | ||
message ("***** CCACHE: DISABLING ABI VERSION CHECK ******") | ||
add_compile_options("-DDISABLE_ABI_CHECK") | ||
# Disable abi compile time checks which renders ccache close to useless | ||
message ("***** CCACHE: DISABLING ABI VERSION CHECK ******") | ||
add_compile_options("-DDISABLE_ABI_CHECK") | ||
else() | ||
message ("***** ccache program not found, ignoring -ccache") | ||
endif() | ||
|
||
endif() |