Add support for Linux arm64 (#446)
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const proc = childProcess.spawn(
|
||||
path.join(moduleInfo.nodeModuleBinDir, "node-gyp" + (hakEnv.isWin() ? ".cmd" : "")),
|
||||
["rebuild"],
|
||||
["rebuild", "--arch", hakEnv.getTargetArch()],
|
||||
{
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
|
||||
@@ -205,14 +205,15 @@ async function buildSqlCipherUnix(hakEnv: HakEnv, moduleInfo: DependencyInfo): P
|
||||
|
||||
const cflags = ["-DSQLITE_HAS_CODEC"];
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
// If the caller has specified CFLAGS then we shouldn't specify target
|
||||
// as their compiler may be incompatible (gcc)
|
||||
if (!hakEnv.isHost() && !process.env.CFLAGS) {
|
||||
// `clang` uses more logical option naming.
|
||||
cflags.push(`--target=${hakEnv.getTargetId()}`);
|
||||
}
|
||||
|
||||
if (cflags.length) {
|
||||
args.push(`CFLAGS=${cflags.join(" ")}`);
|
||||
}
|
||||
if (process.env.CFLAGS) cflags.unshift(process.env.CFLAGS);
|
||||
args.push(`CFLAGS=${cflags.join(" ")}`);
|
||||
|
||||
const ldflags: string[] = [];
|
||||
|
||||
@@ -222,6 +223,7 @@ async function buildSqlCipherUnix(hakEnv: HakEnv, moduleInfo: DependencyInfo): P
|
||||
}
|
||||
|
||||
if (ldflags.length) {
|
||||
if (process.env.LDFLAGS) ldflags.unshift(process.env.LDFLAGS);
|
||||
args.push(`LDFLAGS=${ldflags.join(" ")}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
|
||||
await new Promise((resolve, reject) => {
|
||||
const rustc = childProcess.execFile(
|
||||
"rustc",
|
||||
["--target", hakEnv.getTargetId(), "-o", "tmp", "-"],
|
||||
["--target", hakEnv.getTargetId(), "--emit=obj", "-o", "tmp", "-"],
|
||||
(err, out) => {
|
||||
if (err) {
|
||||
reject(
|
||||
@@ -86,6 +86,8 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
|
||||
},
|
||||
);
|
||||
rustc.stdin!.write("fn main() {}");
|
||||
rustc.stdout!.pipe(process.stdout);
|
||||
rustc.stderr!.pipe(process.stderr);
|
||||
rustc.stdin!.end();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user