1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Resolve cross-compile for rust (#1481)

This commit is contained in:
Oscar Hinton
2022-04-11 19:53:16 +02:00
committed by GitHub
parent 31523bdf0e
commit 2e3c89269d
9 changed files with 343 additions and 152 deletions

22
desktop_native/build.js Normal file
View File

@@ -0,0 +1,22 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const child_process = require("child_process");
const process = require("process");
let targets = [];
switch (process.platform) {
case "win32":
targets = ["i686-pc-windows-msvc", "x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"];
break;
case "darwin":
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"];
break;
default:
targets = ['x86_64-unknown-linux-gnu'];
break;
}
targets.forEach(target => {
child_process.execSync(`npm run build -- --target ${target}`, {stdio: 'inherit'});
});