fix gcc-wrapper for ccache.exe

This reverts a part of 18cc01b639 .

Change-Id: Ib7abbc41eeb6abd573f540ae2d0d2822e68b9abb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124613
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
This commit is contained in:
Luboš Luňák
2021-11-02 18:28:53 +00:00
committed by Luboš Luňák
parent 33db559089
commit 9b9a8f4789
5 changed files with 10 additions and 15 deletions

View File

@@ -667,8 +667,6 @@ export TOUCH=@TOUCH@
export UCRTSDKDIR=@UCRTSDKDIR@
export UCRTVERSION=@UCRTVERSION@
export UCRT_REDISTDIR=@UCRT_REDISTDIR@
export UNCACHED_CC=@UNCACHED_CC@
export UNCACHED_CXX=@UNCACHED_CXX@
export USE_LD=@USE_LD@
export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@
export USE_XINERAMA=@USE_XINERAMA@

View File

@@ -4318,7 +4318,6 @@ AC_SUBST(SHOWINCLUDES_PREFIX)
#
# prefix C with ccache if needed
#
UNCACHED_CC="$CC"
if test "$CCACHE" != ""; then
AC_MSG_CHECKING([whether $CC_BASE is already ccached])
@@ -6792,7 +6791,6 @@ AC_SUBST(BOOST_CXXFLAGS)
#
# prefx CXX with ccache if needed
#
UNCACHED_CXX="$CXX"
if test "$CCACHE" != ""; then
AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
AC_LANG_PUSH([C++])
@@ -12360,8 +12358,6 @@ fi
#
# prefix LO_CLANG_CC/LO_CLANG_CXX with ccache if needed
#
UNCACHED_CLANG_CC="$LO_CLANG_CC"
UNCACHED_CLANG_CXX="$LO_CLANG_CXX"
if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
AC_MSG_CHECKING([whether $LO_CLANG_CC is already ccached])
AC_LANG_PUSH([C])
@@ -12402,12 +12398,8 @@ if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
AC_LANG_POP([C++])
fi
AC_SUBST(UNCACHED_CC)
AC_SUBST(UNCACHED_CXX)
AC_SUBST(LO_CLANG_CC)
AC_SUBST(LO_CLANG_CXX)
AC_SUBST(UNCACHED_CLANG_CC)
AC_SUBST(UNCACHED_CLANG_CXX)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE2)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41)

View File

@@ -623,10 +623,10 @@ endef
# /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe
gb_AUTOCONF_WRAPPERS = \
REAL_CC="$(shell cygpath -w $(filter-out -%,$(UNCACHED_CC)))" \
REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \
REAL_CC_FLAGS="$(filter -%,$(CC))" \
CC="$(call gb_Executable_get_target_for_build,gcc-wrapper)" \
REAL_CXX="$(shell cygpath -w $(filter-out -%,$(UNCACHED_CXX)))" \
REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \
REAL_CXX_FLAGS="$(filter -%,$(CXX))" \
CXX="$(call gb_Executable_get_target_for_build,g++-wrapper)" \
LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"

View File

@@ -319,7 +319,7 @@ endef
# we explicitly have to replace cygwin with mingw32 for the host, but the build must stay cygwin, or cmd.exe processes will be spawned
gb_WIN_GPG_WINDRES_target := $(if $(filter INTEL,$(CPUNAME)),pe-i386,pe-x86-64)
gb_WIN_GPG_platform_switches := --build=$(BUILD_PLATFORM) --host=$(subst cygwin,mingw32,$(HOST_PLATFORM))
gb_WIN_GPG_cross_setup_exports = export REAL_BUILD_CC="$(filter-out -%,$(UNCACHED_CC))" REAL_BUILD_CC_FLAGS="$(filter -%,$(UNCACHED_CC))" \
gb_WIN_GPG_cross_setup_exports = export REAL_BUILD_CC="$(filter-out -%,$(CC_FOR_BUILD))" REAL_BUILD_CC_FLAGS="$(filter -%,$(CC_FOR_BUILD))" \
&& export CC_FOR_BUILD="$(call gb_Executable_get_target_for_build,gcc-wrapper) --wrapper-env-prefix=REAL_BUILD_ $(SOLARINC) -L$(subst ;, -L,$(ILIB_FOR_BUILD))" \
&& export RC='windres -O COFF --target=$(gb_WIN_GPG_WINDRES_target) --preprocessor=$(call gb_Executable_get_target_for_build,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'

View File

@@ -251,9 +251,14 @@ int startprocess(std::string command, std::string args, bool verbose)
// support ccache
size_t pos=command.find("ccache ");
size_t len = strlen("ccache ");
if(pos == std::string::npos) {
pos=command.find("ccache.exe ");
len = strlen("ccache.exe ");
}
if(pos != std::string::npos) {
args.insert(0,"cl.exe");
command=command.substr(0,pos+strlen("ccache"))+".exe";
args.insert(0,command.substr(pos+len));
command=command.substr(0,pos+len-1);
}
auto cmdline = "\"" + command + "\" " + args;