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

simply set ccache env.vars instead of just warning about them

So that it works out of the box automagically.

Change-Id: I0a6c93824233eef6ce25c44762ec40770ec5110f
Reviewed-on: https://gerrit.libreoffice.org/71628
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 18bda682
......@@ -5075,18 +5075,6 @@ elif test "$enable_pch" = "no"; then
else
AC_MSG_ERROR([Unknown value for --enable-pch])
fi
if test -n "$ENABLE_PCH"; then
if test -n "$CCACHE"; then
if ! echo "$CCACHE_SLOPPINESS" | grep -q pch_defines | grep -q time_macros; then
AC_MSG_WARN([PCH with ccache requires CCACHE_SLOPPINESS to include 'pch_defines,time_macros'])
add_warning "PCH with ccache requires CCACHE_SLOPPINESS to include 'pch_defines,time_macros'"
fi
if test -z "$CCACHE_PCH_EXTSUM"; then
AC_MSG_WARN([It is recommended to set CCACHE_PCH_EXTSUM=1 for PCH with ccache.])
add_warning "It is recommended to set CCACHE_PCH_EXTSUM=1 for PCH with ccache."
fi
fi
fi
AC_SUBST(ENABLE_PCH)
TAB=`printf '\t'`
......
......@@ -35,6 +35,9 @@ else
gb_AR := $(shell $(CC) -print-prog-name=ar)
endif
# shell setup (env.vars) for the compiler
gb_COMPILER_SETUP :=
ifneq ($(USE_LD),)
gb_LinkTarget_LDFLAGS += -fuse-ld=$(USE_LD)
endif
......@@ -234,7 +237,7 @@ ifeq ($(COMPILER_PLUGINS_DEBUG),TRUE)
gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --debug
endif
# set CCACHE_CPP2=1 to prevent clang generating spurious warnings
gb_COMPILER_SETUP := CCACHE_CPP2=1
gb_COMPILER_SETUP += CCACHE_CPP2=1
gb_COMPILER_PLUGINS_SETUP := ICECC_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox CCACHE_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox
gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \
-Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors
......@@ -242,9 +245,7 @@ else
# Set CCACHE_CPP2 to prevent GCC -Werror=implicit-fallthrough= when ccache strips comments from C
# code (which still needs /*fallthrough*/-style comments to silence that warning):
ifeq ($(ENABLE_WERROR),TRUE)
gb_COMPILER_SETUP := CCACHE_CPP2=1
else
gb_COMPILER_SETUP :=
gb_COMPILER_SETUP += CCACHE_CPP2=1
endif
gb_COMPILER_TEST_FLAGS :=
gb_COMPILER_PLUGINS :=
......@@ -286,4 +287,19 @@ endef
gb_Helper_get_rcfile = $(1)rc
ifneq ($(ENABLE_PCH),)
# Enable use of .sum files for PCHs.
gb_COMPILER_SETUP += CCACHE_PCH_EXTSUM=1
# CCACHE_SLOPPINESS should contain pch_defines,time_macros for PCHs.
gb_CCACHE_SLOPPINESS :=
ifeq ($(shell test -z "$$CCACHE_SLOPPINESS" && echo 1),1)
gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=pch_defines,time_macros
else
ifeq ($(shell echo "$$CCACHE_SLOPPINESS" | grep -q pch_defines | grep -q time_macros && echo 1),1)
gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS:pch_defines,time_macros
endif
endif
gb_COMPILER_SETUP += $(gb_CCACHE_SLOPPINESS)
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