fix(cli): set cxxflags while WASI_SDK_PATH exists (#1955)

This commit is contained in:
LongYinan 2024-02-17 14:42:30 +08:00 committed by GitHub
parent 20e0983288
commit 09efd416e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -267,6 +267,13 @@ class Builder {
) {
this.envs.CFLAGS = `--sysroot=${this.envs.TARGET_SYSROOT}`
}
if (
(process.env.CXX === 'clang++' &&
(process.env.TARGET_CXX === 'clang++' || !process.env.TARGET_CXX)) ||
process.env.TARGET_CXX === 'clang++'
) {
this.envs.CXXFLAGS = `--sysroot=${this.envs.TARGET_SYSROOT}`
}
} catch (e) {
debug.warn('Pick cross toolchain failed', e as Error)
// ignore, do nothing