Skip to content

Commit

Permalink
Update build script to build ARM64 version on Apple Silicon machines (#…
Browse files Browse the repository at this point in the history
…1918)

* $ Refactor build script

* * Update build script to build ARM64 on Apple Silicon
  • Loading branch information
PikachuEXE authored May 14, 2022
1 parent 1cbf6b5 commit 80b1e43
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions _scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ const { name, productName } = require('../package.json')
const args = process.argv

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

if (platform == 'darwin') {
targets = Platform.MAC.createTarget()
} else if (platform == 'win32') {
if (platform === 'darwin') {
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') {
} else if (platform === 'linux') {
let arch = Arch.x64

if (args[2] === 'arm64') {
Expand Down

0 comments on commit 80b1e43

Please sign in to comment.