mirror of
https://github.com/ceph/ceph
synced 2024-12-29 15:03:33 +00:00
cmake: Support sccache
Signed-off-by: Zack Cerza <zack@redhat.com>
This commit is contained in:
parent
5177c5855f
commit
0c345becf8
@ -83,6 +83,21 @@ if(WITH_CCACHE)
|
||||
endif()
|
||||
endif(WITH_CCACHE)
|
||||
|
||||
option(WITH_SCCACHE "Build with sccache.")
|
||||
if(WITH_SCCACHE)
|
||||
if(CMAKE_C_COMPILER_LAUNCHER OR CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
message(WARNING "Compiler launcher already set. stop configuring sccache")
|
||||
else()
|
||||
find_program(SCCACHE_EXECUTABLE sccache)
|
||||
if(NOT SCCACHE_EXECUTABLE)
|
||||
message(FATAL_ERROR "Can't find sccache. Is it installed?")
|
||||
endif()
|
||||
message(STATUS "Building with sccache: ${SCCACHE_EXECUTABLE}, SCCACHE_CONF=$ENV{SCCACHE_CONF}")
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_EXECUTABLE})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_EXECUTABLE})
|
||||
endif()
|
||||
endif(WITH_SCCACHE)
|
||||
|
||||
option(WITH_MANPAGE "Build man pages." ON)
|
||||
if(WITH_MANPAGE)
|
||||
find_program(SPHINX_BUILD
|
||||
|
@ -58,7 +58,10 @@ fi
|
||||
|
||||
ARGS+=" -DWITH_PYTHON3=${PYBUILD}"
|
||||
|
||||
if type ccache > /dev/null 2>&1 ; then
|
||||
if type sccache > /dev/null 2>&1 ; then
|
||||
echo "enabling sccache"
|
||||
ARGS+=" -DWITH_SCCACHE=ON"
|
||||
elif type ccache > /dev/null 2>&1 ; then
|
||||
echo "enabling ccache"
|
||||
ARGS+=" -DWITH_CCACHE=ON"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user