summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-11-02 18:28:53 +0000
committerLuboš Luňák <l.lunak@collabora.com>2021-11-03 07:27:21 +0100
commit9b9a8f47894760e7a95ed276feeef00d3b1c94d1 (patch)
treed9304e87909718eab1b4a07061314204900b3637 /solenv
parent33db559089fcf5ff9f6e0e5bb4e41fce969cbdad (diff)
fix gcc-wrapper for ccache.exe
This reverts a part of 18cc01b63996f81b284e3bc827d1be7f3da8983a . Change-Id: Ib7abbc41eeb6abd573f540ae2d0d2822e68b9abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124613 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk4
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk2
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx9
3 files changed, 10 insertions, 5 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index f02e2a48649f..f0da634be0b9 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -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"
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 8dccadd1f743..e1912285c4b7 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -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)'
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 72e48e5a7b37..3504d3d8c5ab 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -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;