Skip to content

Commit

Permalink
fix(cli): setup cxx env while using napi-cross (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 8, 2024
1 parent b6adf8a commit 0205fd9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/src/api/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) ||
Expand Down

0 comments on commit 0205fd9

Please sign in to comment.