fix(binding): add riscv64 binding (#1851)
This commit is contained in:
parent
a697cf1cf5
commit
e3902e001f
1 changed files with 29 additions and 0 deletions
|
@ -274,6 +274,35 @@ switch (platform) {
|
|||
loadError = e
|
||||
}
|
||||
break
|
||||
case 'riscv64':
|
||||
if (isMusl()) {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, '${localName}.linux-riscv64-musl.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./${localName}.linux-riscv64-musl.node')
|
||||
} else {
|
||||
nativeBinding = require('${pkgName}-linux-riscv64-musl')
|
||||
}
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
}
|
||||
} else {
|
||||
localFileExisted = existsSync(
|
||||
join(__dirname, '${localName}.linux-riscv64-gnu.node')
|
||||
)
|
||||
try {
|
||||
if (localFileExisted) {
|
||||
nativeBinding = require('./${localName}.linux-riscv64-gnu.node')
|
||||
} else {
|
||||
nativeBinding = require('${pkgName}-linux-riscv64-gnu')
|
||||
}
|
||||
} catch (e) {
|
||||
loadError = e
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new Error(\`Unsupported architecture on Linux: \${arch}\`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue