Update build script to build ARM64 version on Apple Silicon machines (#1918)
* $ Refactor build script * * Update build script to build ARM64 on Apple Silicon
This commit is contained in:
parent
1cbf6b5159
commit
80b1e436f8
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue