Skip to content
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

rafactor: optimize ccache configuration #64

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions cmake/build/Ccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ set(USE_CCACHE
ON
CACHE BOOL "use ccache to speed up compiling.")

message(STATUS "Use Ccache with USE_CCACHE: ${USE_CCACHE}
Ccache Options:
USE_CCACHE: If use ccache to speed up compiling. Default is ON.")

if(NOT USE_CCACHE)
message(STATUS "Disable ccache")
message(STATUS "Disable ccache because of USE_CCACHE is OFF")
return()
endif()

Expand All @@ -23,14 +27,14 @@ find_program(
NAMES ccache
DOC "ccache executable")

if(CCACHE_COMMAND)
message(STATUS "Activate ccache: ${CCACHE_COMMAND}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_COMMAND}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_COMMAND}")

# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)

# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
else()
if(NOT CCACHE_COMMAND)
message(WARNING "Disable ccache because of no ccache installed")
return()
endif()

set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_COMMAND}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_COMMAND}")

# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)

# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
Loading