clarified overlapping terms: arch, host, target
This commit is contained in:
parent
dcc423da4f
commit
a48642e49a
@ -4,7 +4,7 @@ function getAbi () {
|
||||
return 'm' + process.versions.modules;
|
||||
}
|
||||
|
||||
function getArmArch () {
|
||||
function getArmHost () {
|
||||
var cpu = fs.readFileSync('/proc/cpuinfo', 'utf8');
|
||||
if (cpu.indexOf('vfpv3') >= 0) return 'armv7';
|
||||
var name = cpu.split('model name')[1];
|
||||
@ -14,20 +14,20 @@ function getArmArch () {
|
||||
return 'armv6';
|
||||
}
|
||||
|
||||
function getArch () {
|
||||
var arch = process.arch;
|
||||
if (arch === 'ia32') return 'x86';
|
||||
if (arch === 'arm') return getArmArch();
|
||||
return arch;
|
||||
function getHost () {
|
||||
var host = process.arch;
|
||||
if (host === 'ia32') return 'x86';
|
||||
if (host === 'arm') return getArmHost();
|
||||
return host;
|
||||
}
|
||||
|
||||
function getTargets () {
|
||||
const a = getArch();
|
||||
if (a === 'x64') return [ 'x64', 'x86' ];
|
||||
const host = getHost();
|
||||
if (host === 'x64') return [ 'x64', 'x86' ];
|
||||
// TODO find a way to crosscompile for armv6 on armv7
|
||||
return [ a ];
|
||||
return [ host ];
|
||||
}
|
||||
|
||||
export const abi = getAbi();
|
||||
export const arch = getArch();
|
||||
export const host = getHost();
|
||||
export const targets = getTargets();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user