summaryrefslogtreecommitdiff
path: root/Ports/.port_include.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-04-27 17:10:18 +0200
committerLinus Groh <mail@linusgroh.de>2021-04-27 18:01:43 +0200
commit0b47ea408c1d4cb2c367f97fec1715da87bb726c (patch)
treea4ee6be258840e87aa087e60e85e08345825003a /Ports/.port_include.sh
parent7576761543cb05df7743c31d6f53f9cf0e77e20d (diff)
downloadserenity-0b47ea408c1d4cb2c367f97fec1715da87bb726c.zip
Ports: Change how we invoke ccache because some ports didn't use it
This prepends ccache to the PATH instead of setting CC/CXX. Doing it this way ensures all ports use ccache because some of them didn't before.
Diffstat (limited to 'Ports/.port_include.sh')
-rwxr-xr-xPorts/.port_include.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh
index 3b86adafd2..9a1c1bd8a8 100755
--- a/Ports/.port_include.sh
+++ b/Ports/.port_include.sh
@@ -23,8 +23,12 @@ maybe_source() {
enable_ccache() {
if command -v ccache &>/dev/null; then
- export CC="ccache ${CC}"
- export CXX="ccache ${CXX}"
+ ccache_tooldir="${SERENITY_BUILD_DIR}/ccache"
+ mkdir -p "$ccache_tooldir"
+ for tool in gcc g++ c++; do
+ ln -sf "$(command -v ccache)" "${ccache_tooldir}/${SERENITY_ARCH}-pc-serenity-${tool}"
+ done
+ export PATH="${ccache_tooldir}:$PATH"
fi
}