From a87e4a6d9560afc7f44f92cb01b2294cfaa97a37 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 5 Dec 2023 19:06:32 +0800 Subject: [PATCH] fix(cli): set CC env if not existed (#1839) --- cli/src/api/build.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cli/src/api/build.ts b/cli/src/api/build.ts index f60b1cbd..08cdcfc3 100644 --- a/cli/src/api/build.ts +++ b/cli/src/api/build.ts @@ -227,6 +227,18 @@ class Builder { 'include/', ) } + if (!process.env.CC && !process.env.TARGET_CC) { + this.envs[`CC`] = join( + toolchainPath, + 'bin', + `${this.target.triple}-gcc`, + ) + this.envs[`TARGET_CC`] = join( + toolchainPath, + 'bin', + `${this.target.triple}-gcc`, + ) + } if ( (process.env.CC === 'clang' && (process.env.TARGET_CC === 'clang' || !process.env.TARGET_CC)) ||