Skip to content

Commit

Permalink
fixes for arm64 arch, you need to export ARCH=armv7 or arm64 in order…
Browse files Browse the repository at this point in the history
… to have the right call. This is untested. Closes #17
  • Loading branch information
tito committed Feb 18, 2015
1 parent a0c663c commit 26c16a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pyobjus/pyobjus.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,12 @@ cdef class ObjcMethod(object):
dprint("x86_64 architecture {0} call".format(fun_name), of_type='i')

ELIF PLATFORM == 'ios':
ffi_call(&self.f_cif, <void(*)()>objc_msgSend_stret, res_ptr, f_args)
dprint('ios platform objc_msgSend_stret call')
IF ARCH == 'arm64':
ffi_call(&self.f_cif, <void(*)()>objc_msgSend, res_ptr, f_args)
dprint('ios(arm64) platform objc_msgSend call')
ELSE:
ffi_call(&self.f_cif, <void(*)()>objc_msgSend_stret, res_ptr, f_args)
dprint('ios(armv7) platform objc_msgSend_stret call')

ELSE:
dprint("UNSUPPORTED ARCHITECTURE! Program will exit now...", of_type='e')
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
from os.path import dirname, join, exists
import sys
import subprocess
import platform

dev_platform = sys.platform
kivy_ios_root = environ.get('KIVYIOSROOT', None)
arch = environ.get('ARCH', platform.machine())
if kivy_ios_root is not None:
dev_platform = 'ios'

Expand All @@ -24,7 +26,8 @@
# create a configuration file for pyobjus (export the platform)
config_pxi_fn = join(dirname(__file__), 'pyobjus', 'config.pxi')
config_pxi_need_update = True
config_pxi = 'DEF PLATFORM = "{}"'.format(dev_platform)
config_pxi = 'DEF PLATFORM = "{}"\n'.format(dev_platform)
config_pxi += 'DEF ARCH = "{}"'.format(arch)
if exists(config_pxi_fn):
with open(config_pxi_fn) as fd:
config_pxi_need_update = fd.read() != config_pxi
Expand Down

0 comments on commit 26c16a6

Please sign in to comment.