Allow cross compiling (#150)
This commit is contained in:
parent
19d8d077e0
commit
d7f74907ad
@ -4,7 +4,7 @@ import path from 'path';
|
||||
import { spawnSync } from 'child_process';
|
||||
import uniqueTempDir from 'unique-temp-dir';
|
||||
|
||||
import { hostPlatform } from './system';
|
||||
import { hostArch, hostPlatform } from './system';
|
||||
import { log } from './log';
|
||||
import patchesJson from '../patches/patches.json';
|
||||
|
||||
@ -108,6 +108,12 @@ async function compileOnUnix(nodeVersion: string, targetArch: string) {
|
||||
args.push('--dest-cpu', cpu);
|
||||
}
|
||||
|
||||
if (hostArch !== targetArch) {
|
||||
log.warn('Cross compiling!');
|
||||
log.warn('You are responsible for appropriate env like CC, CC_host, etc.');
|
||||
args.push('--cross-compiling');
|
||||
}
|
||||
|
||||
// first of all v8_inspector introduces the use
|
||||
// of `prime_rehash_policy` symbol that requires
|
||||
// GLIBCXX_3.4.18 on some systems
|
||||
|
||||
@ -3,7 +3,6 @@ import path from 'path';
|
||||
import semver from 'semver';
|
||||
import {
|
||||
abiToNodeRange,
|
||||
hostArch,
|
||||
hostPlatform, // eslint-disable-line no-duplicate-imports
|
||||
isValidNodeRange,
|
||||
knownArchs,
|
||||
@ -148,12 +147,6 @@ export async function need(opts: NeedOptions) {
|
||||
);
|
||||
}
|
||||
|
||||
if (hostArch !== arch) {
|
||||
throw wasReported(
|
||||
`Not able to build for '${opts.arch}' here, only for '${hostArch}'`
|
||||
);
|
||||
}
|
||||
|
||||
if (knownArchs.indexOf(arch) < 0) {
|
||||
throw wasReported(
|
||||
`Unknown arch '${opts.arch}'. Specify ${knownArchs.join(', ')}`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user