Skip to content

Commit

Permalink
* Update build script to build ARM64 on Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Feb 7, 2022
1 parent 99a6ca7 commit 0241e91
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion _scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ const args = process.argv

let targets
const platform = os.platform()
const cpus = os.cpus()

if (platform === 'darwin') {
targets = Platform.MAC.createTarget()
let arch = Arch.x64

// Macbook Air 2020 with M1 = 'Apple M1'
// Macbook Pro 2021 with M1 Pro = 'Apple M1 Pro'
if (cpus[0].model.startsWith('Apple')) {
arch = Arch.arm64
}

targets = Platform.MAC.createTarget(['dmg'], arch)
} else if (platform === 'win32') {
targets = Platform.WINDOWS.createTarget()
} else if (platform === 'linux') {
Expand Down

0 comments on commit 0241e91

Please sign in to comment.