aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/ccache_flag.go
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:46:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 04:46:16 +0000
commit2ce6e8be8e2dd5dbed108e6d5387e4bd21c3d04c (patch)
tree77dc031614745bb406dbd90cea9a082a1b5cdd54 /compiler_wrapper/ccache_flag.go
parent904b3e949a93a8953db41e41b256a5b27debeed4 (diff)
parent40214b48188358a80b7478bfff21d4814dd9177c (diff)
downloadtoolchain-utils-2ce6e8be8e2dd5dbed108e6d5387e4bd21c3d04c.tar.gz
Change-Id: Ic798bced996e8800fcd5f3f45be364c0b6d53417
Diffstat (limited to 'compiler_wrapper/ccache_flag.go')
-rw-r--r--compiler_wrapper/ccache_flag.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler_wrapper/ccache_flag.go b/compiler_wrapper/ccache_flag.go
index 02fb43ac..0371f10a 100644
--- a/compiler_wrapper/ccache_flag.go
+++ b/compiler_wrapper/ccache_flag.go
@@ -1,9 +1,14 @@
-// Copyright 2019 The Chromium OS Authors. All rights reserved.
+// Copyright 2019 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package main
+func isInConfigureStage(env env) bool {
+ val, present := env.getenv("EBUILD_PHASE")
+ return present && val == "configure"
+}
+
func processCCacheFlag(builder *commandBuilder) {
// We should be able to share the objects across compilers as
// the pre-processed output will differ. This allows boards
@@ -22,7 +27,7 @@ func processCCacheFlag(builder *commandBuilder) {
// Disable ccache during portage's src_configure phase. Using ccache here is generally a
// waste of time, since these files are very small. Experimentally, this speeds up
// configuring by ~13%.
- if val, present := builder.env.getenv("EBUILD_PHASE"); present && val == "configure" {
+ if isInConfigureStage(builder.env) {
useCCache = false
}