mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
cmake don't automatically enable ccache if already enabled
This commit is contained in:
committed by
Lorenz Meier
parent
73f825e4b3
commit
aaaf67f9c3
@@ -231,7 +231,18 @@ endforeach()
|
|||||||
option(CCACHE "Use ccache if available" ON)
|
option(CCACHE "Use ccache if available" ON)
|
||||||
find_program(CCACHE_PROGRAM ccache)
|
find_program(CCACHE_PROGRAM ccache)
|
||||||
if (CCACHE AND CCACHE_PROGRAM AND NOT DEFINED ENV{CCACHE_DISABLE})
|
if (CCACHE AND CCACHE_PROGRAM AND NOT DEFINED ENV{CCACHE_DISABLE})
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
|
||||||
|
get_filename_component(ccache_real_path ${CCACHE_PROGRAM} REALPATH)
|
||||||
|
get_filename_component(cxx_real_path ${CMAKE_CXX_COMPILER} REALPATH)
|
||||||
|
get_filename_component(cxx_abs_path ${CMAKE_CXX_COMPILER} ABSOLUTE)
|
||||||
|
|
||||||
|
if ("${ccache_real_path}" STREQUAL "${cxx_real_path}")
|
||||||
|
message(STATUS "ccache enabled via symlink (${cxx_abs_path} -> ${cxx_real_path})")
|
||||||
|
else()
|
||||||
|
message(STATUS "ccache enabled (export CCACHE_DISABLE=1 to disable)")
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user