fix(cli): set CC env if not existed (#1839)

This commit is contained in:
LongYinan 2023-12-05 19:06:32 +08:00 committed by GitHub
parent 0b74cf667e
commit a87e4a6d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,6 +227,18 @@ class Builder {
'include/', '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 ( if (
(process.env.CC === 'clang' && (process.env.CC === 'clang' &&
(process.env.TARGET_CC === 'clang' || !process.env.TARGET_CC)) || (process.env.TARGET_CC === 'clang' || !process.env.TARGET_CC)) ||