diff --git a/src/PharoLauncher-Core/MacOSXPlatform.extension.st b/src/PharoLauncher-Core/MacOSXPlatform.extension.st index 0e1b641b..c1d69264 100644 --- a/src/PharoLauncher-Core/MacOSXPlatform.extension.st +++ b/src/PharoLauncher-Core/MacOSXPlatform.extension.st @@ -1,5 +1,10 @@ Extension { #name : #MacOSXPlatform } +{ #category : #'*PharoLauncher-Core' } +MacOSXPlatform class >> armArchitecture [ + ^ 'arm64' +] + { #category : #'*PharoLauncher-Core' } MacOSXPlatform >> canRun32bitApp [ ^ self version asInteger < 1015 "OS X Mojave 10.15 drop support of 32-bit application " @@ -7,7 +12,20 @@ MacOSXPlatform >> canRun32bitApp [ { #category : #'*PharoLauncher-Core' } MacOSXPlatform >> hostArchitecture [ - ^ (LibC resultOfCommand: 'uname -m') trim + | archName | + archName := (LibC resultOfCommand: 'uname -m') trim. + + ^ archName = self class intelArchitecture + ifTrue: [ (LibC resultOfCommand: 'sysctl -in sysctl.proc_translated') trim = '1' + ifTrue: [ "Running on Rosetta 2" self class armArchitecture ] + ifFalse: [ "Running native Intel" archName ] ] + ifFalse: [ archName ] + +] + +{ #category : #'*PharoLauncher-Core' } +MacOSXPlatform class >> intelArchitecture [ + ^ 'x86_64' ] { #category : #'*PharoLauncher-Core' }