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
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