File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,23 @@ install_sdk() {
7676 yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root=" ${SDK_INSTALLATION_DIR} " --install " tools"
7777}
7878
79+ function write_android_sccache_stub() {
80+ BINARY=$1
81+ mv " /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$1 " " /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1 "
82+ cat > " /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$1 " << EOF
83+ #!/bin/sh
84+ if [ command -v sccache && \$ (env -u LD_PRELOAD ps -p \$ PPID -o comm=) != sccache ]; then
85+ exec sccache /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1 "\$ @"
86+ else
87+ exec /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1 "\$ @"
88+ fi
89+ EOF
90+ chmod a+x " /opt/toolchains/llvm/prebuilt/linux-x86_64/bin/${BINARY} "
91+ }
92+
7993install_prerequiresites
8094install_ndk
8195install_cmdtools
8296install_sdk
97+ write_android_sccache_stub clang++
98+ write_android_sccache_stub clang
You can’t perform that action at this time.
0 commit comments