Skip to content

Commit

Permalink
detect Pharo Launcher running on Rosetta
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Jul 12, 2021
1 parent 0c1c490 commit 76ad243
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/PharoLauncher-Core/MacOSXPlatform.extension.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
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 "
]

{ #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' }
Expand Down

0 comments on commit 76ad243

Please sign in to comment.