fix(cli): setup cxx env while using napi-cross (#1942)

This commit is contained in:
LongYinan 2024-02-08 21:23:40 +08:00 committed by GitHub
parent b6adf8ae5c
commit 0205fd976e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -248,6 +248,18 @@ class Builder {
`${this.target.triple}-gcc`,
)
}
if (!process.env.CXX && !process.env.TARGET_CXX) {
this.envs[`CXX`] = join(
toolchainPath,
'bin',
`${this.target.triple}-g++`,
)
this.envs[`TARGET_CXX`] = join(
toolchainPath,
'bin',
`${this.target.triple}-g++`,
)
}
if (
(process.env.CC === 'clang' &&
(process.env.TARGET_CC === 'clang' || !process.env.TARGET_CC)) ||