OSX: Only compile for x86_64

This commit is contained in:
Christopher Denter 2011-02-13 16:06:19 +01:00
parent b7e7ea195a
commit ed112fac47
1 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,16 @@ if True:
pyxl.pop(0)
return '.'.join(pyxl)
OrigExtension = Extension
def Extension(*args, **kwargs):
# Small hack to only compile for x86_64 on OSX.
# Is there a better way to do this?
if platform == 'darwin':
extra_args = ['-arch', 'x86_64']
kwargs['extra_compile_args'] = extra_args + kwargs.get('extra_compile_args', [])
kwargs['extra_link_args'] = extra_args + kwargs.get('extra_link_args', [])
return OrigExtension(*args, **kwargs)
# simple extensions
for pyx in (x for x in pyx_files if not 'graphics' in x):
module_name = get_modulename_from_file(pyx)