From ae0fe0d05cdc19283aaa3563d8c1423bc20dd34c Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 30 Jan 2026 17:19:13 +0000 Subject: [PATCH] add ccache support for custom toolchain (#180737) Add ccache support when building the engine using a custom toolchain. Fixes #180736 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. --- engine/src/build/toolchain/custom/BUILD.gn | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/src/build/toolchain/custom/BUILD.gn b/engine/src/build/toolchain/custom/BUILD.gn index 3da5f930269..c5d2a60af75 100644 --- a/engine/src/build/toolchain/custom/BUILD.gn +++ b/engine/src/build/toolchain/custom/BUILD.gn @@ -3,15 +3,20 @@ # found in the LICENSE file. import("//build/toolchain/custom/custom.gni") +import("//build/toolchain/ccache.gni") toolchain("custom") { toolchain_bin = "${custom_toolchain}/bin" + compiler_prefix = "" + if (use_ccache) { + compiler_prefix = "ccache " + } # We can't do string interpolation ($ in strings) on things with dots in # them. To allow us to use $cc below, for example, we create copies of # these values in our scope. - cc = "${toolchain_bin}/clang" - cxx = "${toolchain_bin}/clang++" + cc = "${compiler_prefix}${toolchain_bin}/clang" + cxx = "${compiler_prefix}${toolchain_bin}/clang++" ar = "${toolchain_bin}/${custom_target_triple}-ar" ld = "${toolchain_bin}/clang++" readelf = "${toolchain_bin}/${custom_target_triple}-readelf"