From d2fbcd07b752e1ec0857bc8f79d11a641ef77b5f Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 8 Jun 2023 11:28:00 +0800 Subject: [PATCH] Use sccache on non CI env --- .github/workflows/build.yml | 3 --- build.py | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1da287769..20f9fac1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,10 +24,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] env: - NDK_CCACHE: sccache - RUSTC_WRAPPER: sccache SCCACHE_GHA_ENABLED: true - CARGO_INCREMENTAL: 0 steps: - name: Check out diff --git a/build.py b/build.py index 8343b383b..a89beae8f 100755 --- a/build.py +++ b/build.py @@ -59,6 +59,11 @@ if not sys.version_info >= (3, 8): if "ANDROID_SDK_ROOT" not in os.environ: error("Please set Android SDK path to environment variable ANDROID_SDK_ROOT!") +if shutil.which("sccache") is not None: + os.environ["RUSTC_WRAPPER"] = "sccache" + os.environ["NDK_CCACHE"] = "sccache" + os.environ["CARGO_INCREMENTAL"] = "0" + cpu_count = multiprocessing.cpu_count() os_name = platform.system().lower()