mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 15:34:59 +01:00
Cross-compile SQLCipher for aarch64-apple-darwin
This commit is contained in:
parent
c57a173649
commit
f3c1db3313
@ -182,9 +182,36 @@ async function buildSqlCipherUnix(hakEnv, moduleInfo) {
|
||||
if (hakEnv.isMac()) {
|
||||
args.push('--with-crypto-lib=commoncrypto');
|
||||
}
|
||||
args.push('CFLAGS=-DSQLITE_HAS_CODEC');
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
// In the nonsense world of `configure`, it is assumed you are building
|
||||
// a compiler like `gcc`, so the `host` option actually means the target
|
||||
// the build output runs on.
|
||||
args.push(`--host=${hakEnv.getTargetId()}`);
|
||||
}
|
||||
|
||||
const cflags = [
|
||||
'-DSQLITE_HAS_CODEC',
|
||||
];
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
// `clang` uses more logical option naming.
|
||||
cflags.push(`--target=${hakEnv.getTargetId()}`);
|
||||
}
|
||||
|
||||
if (cflags.length) {
|
||||
args.push(`CFLAGS=${cflags.join(' ')}`);
|
||||
}
|
||||
|
||||
const ldflags = [];
|
||||
|
||||
if (hakEnv.isMac()) {
|
||||
args.push('LDFLAGS=-framework Security -framework Foundation');
|
||||
ldflags.push('-framework Security');
|
||||
ldflags.push('-framework Foundation');
|
||||
}
|
||||
|
||||
if (ldflags.length) {
|
||||
args.push(`LDFLAGS=${ldflags.join(' ')}`);
|
||||
}
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
|
@ -67,7 +67,7 @@ module.exports = async function(hakEnv, moduleInfo) {
|
||||
if (err) {
|
||||
reject("Can't find rustup");
|
||||
}
|
||||
const target = hakEnv.getRustTarget();
|
||||
const target = hakEnv.getTargetId();
|
||||
if (!out.includes(target)) {
|
||||
reject(`Rust target ${target} not installed`);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ module.exports = class HakEnv {
|
||||
return this.getRuntimeAbi() + '-' + this.target.platform + '-' + this.target.arch;
|
||||
}
|
||||
|
||||
getRustTarget() {
|
||||
getTargetId() {
|
||||
return this.target.id;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user