Kaydet (Commit) 689829db authored tarafından Luboš Luňák's avatar Luboš Luňák

if ccache is enabled, by default also enable CCACHE_DEPEND

This avoids the preprocessing step normally done by ccache (see
ccache docs), which speeds up the build.
This way there may be incorrect ccache hits if a system header
(found using -isystem) changes, but that should be rare and such
headers generally should be backwards compatible, so the chance
of an actual breakage should be very low.
The patch also adds --enable-ccache=nodepend to allow enabling ccache
without the depend mode.

https://lists.freedesktop.org/archives/libreoffice/2019-May/082684.html

Change-Id: Id69ca43988a016a917beb75927b39d8bde719aa7
Reviewed-on: https://gerrit.libreoffice.org/71629
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 7f992595
......@@ -58,6 +58,7 @@ export BZIP2_LIBS=$(gb_SPACE)@BZIP2_LIBS@
export CAIRO_CFLAGS=$(gb_SPACE)@CAIRO_CFLAGS@
export CAIRO_LIBS=$(gb_SPACE)@CAIRO_LIBS@
export CC=@CC@
export CCACHE_DEPEND_MODE=@CCACHE_DEPEND_MODE@
export CDR_CFLAGS=$(gb_SPACE)@CDR_CFLAGS@
export CDR_LIBS=$(gb_SPACE)@CDR_LIBS@
@x_CFLAGS@ export CFLAGS=@CFLAGS@
......
......@@ -1370,6 +1370,8 @@ AC_ARG_ENABLE(ccache,
By default, unless on Windows, we will try to detect if ccache is available; in that case if
CC/CXX are not yet set, and --enable-icecream is not given, we
attempt to use ccache. --disable-ccache disables ccache completely.
Additionally ccache's depend mode is enabled if possible,
use --enable-ccache=nodepend to enable ccache without depend mode.
]),
,)
......@@ -2573,21 +2575,26 @@ AC_SUBST(WITH_GALLERY_BUILD)
dnl ===================================================================
dnl Checks if ccache is available
dnl ===================================================================
CCACHE_DEPEND_MODE=
if test "$_os" = "WINNT"; then
# on windows/VC build do not use ccache
CCACHE=""
elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
elif test "$enable_ccache" = "no"; then
CCACHE=""
elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
case "%$CC%$CXX%" in
# If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
# assume that's good then
*%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
CCACHE_DEPEND_MODE=1
;;
*)
AC_PATH_PROG([CCACHE],[ccache],[not found])
if test "$CCACHE" = "not found"; then
CCACHE=""
else
CCACHE_DEPEND_MODE=1
# Need to check for ccache version: otherwise prevents
# caching of the results (like "-x objective-c++" for Mac)
if test $_os = Darwin -o $_os = iOS; then
......@@ -2600,6 +2607,7 @@ elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecr
else
AC_MSG_RESULT([no, $CCACHE_VERSION])
CCACHE=""
CCACHE_DEPEND_MODE=
fi
fi
fi
......@@ -2608,6 +2616,10 @@ elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecr
else
CCACHE=""
fi
if test "$enable_ccache" = "nodepend"; then
CCACHE_DEPEND_MODE=""
fi
AC_SUBST(CCACHE_DEPEND_MODE)
if test "$CCACHE" != ""; then
ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
......
......@@ -302,4 +302,8 @@ endif
gb_COMPILER_SETUP += $(gb_CCACHE_SLOPPINESS)
endif
ifneq ($(CCACHE_DEPEND_MODE),)
gb_COMPILER_SETUP += CCACHE_DEPEND=1
endif
# vim: set noet sw=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment