Skip to content

Commit 42c323a

Browse files
committed
ssh_client: integrate ccache automatically
Change-Id: Iae00f18342b11b533f6faeee2db03d67327a87a1 Reviewed-on: https://chromium-review.googlesource.com/c/apps/libapps/+/5838171 Reviewed-by: Joel Hockey <[email protected]> Tested-by: kokoro <[email protected]>
1 parent 05b5185 commit 42c323a

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

ssh_client/bin/ssh_client.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@ def from_id(cls, name):
167167
return cls(_toolchain_wasm_env())
168168

169169
assert name == "build"
170-
return cls({})
170+
return cls(
171+
{
172+
"CC": "gcc",
173+
"CXX": "g++",
174+
}
175+
)
171176

172177
def activate(self):
173178
"""Update the current environment with this toolchain."""
@@ -191,6 +196,10 @@ def activate(self):
191196
if var not in self._env:
192197
os.environ.pop(var, None)
193198

199+
if shutil.which("ccache"):
200+
for var in ("CC", "CXX"):
201+
os.environ[var] = f"ccache {os.environ[var]}"
202+
194203
@property
195204
def chost(self):
196205
"""Get the current hsst system."""

ssh_client/third_party/openssl/build

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PATCHES = (
2424
"openssl-1.0.2a-parallel-obj-headers.patch",
2525
"openssl-1.0.2a-parallel-install-dirs.patch",
2626
"openssl-1.0.2a-parallel-symlinking.patch",
27+
"openssl-1.0.2k-domd-hack.patch",
2728
)
2829

2930

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
the domd script is a huge hack already, so add a little more to handle ccache
2+
3+
--- a/util/domd
4+
+++ b/util/domd
5+
@@ -6,6 +6,7 @@
6+
shift
7+
if [ "$1" = "-MD" ]; then
8+
shift
9+
+ [ "$1" = "ccache" ] && shift
10+
MAKEDEPEND=$1
11+
shift
12+
fi

0 commit comments

Comments
 (0)