All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] qt5: use ccache for building host code
@ 2018-10-20 13:25 Thomas Petazzoni
  2018-11-03 13:49 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2018-10-20 13:25 UTC (permalink / raw)
  To: buildroot

qt5 currently doesn't use HOSTCC/HOSTCXX, so it doesn't use ccache
when building all its host code (especially qmake). This means that
even with ccache enabled and a hot cache, it still takes a long time
to build qt5base.

Before this patch, building qt5base takes:

 - 446 seconds with a cold ccache
 - 185 seconds with a hot ccache

This is because the ccache is not used for host code.

After this patch, building qt5base takes:

 - 450 seconds with a cold ccache
 - 15 seconds with a hot ccache

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/qt5/qt5base/qt5base.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index ab2b883fc4..d9f7af7196 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -264,6 +264,13 @@ define QT5BASE_CONFIGURE_ARCH_CONFIG
 endef
 endif
 
+# This allows to use ccache when available
+define QT5BASE_CONFIGURE_HOSTCC
+	$(SED) 's,^QMAKE_COMPILER\s*=.*,QMAKE_COMPILER=$(HOSTCC),' $(@D)/mkspecs/common/g++-base.conf
+	$(SED) 's,^QMAKE_CC\s*=.*,QMAKE_CC=$(HOSTCC),' $(@D)/mkspecs/common/g++-base.conf
+	$(SED) 's,^QMAKE_CXX\s*=.*,QMAKE_CXX=$(HOSTCXX),' $(@D)/mkspecs/common/g++-base.conf
+endef
+
 define QT5BASE_CONFIGURE_CMDS
 	mkdir -p $(@D)/mkspecs/devices/linux-buildroot-g++/
 	sed 's/@EGLFS_DEVICE@/$(QT5BASE_EGLFS_DEVICE)/g' \
@@ -274,6 +281,7 @@ define QT5BASE_CONFIGURE_CMDS
 	$(QT5BASE_CONFIGURE_CONFIG_FILE)
 	touch $(QT5BASE_ARCH_CONFIG_FILE)
 	$(QT5BASE_CONFIGURE_ARCH_CONFIG)
+	$(QT5BASE_CONFIGURE_HOSTCC)
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-30  9:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-20 13:25 [Buildroot] [PATCH] qt5: use ccache for building host code Thomas Petazzoni
2018-11-03 13:49 ` Thomas Petazzoni
2018-11-04 21:08   ` Peter Seiderer
2018-11-04 21:12 ` Peter Seiderer
2018-11-04 21:25   ` Thomas Petazzoni
2018-11-04 21:46     ` Peter Seiderer
2018-11-05  7:49       ` Thomas Petazzoni
2018-11-05 20:16         ` Peter Seiderer
2018-11-30  9:00 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.