pfreeze: Support building for macOS arm64 architecture

This commit is contained in:
rdb 2020-12-15 18:59:04 +01:00
parent 6f35cb0235
commit 4d50e73132

View File

@ -222,7 +222,7 @@ class CompilationEnvironment:
self.linkDll = 'link /nologo /DLL /MAP:NUL /FIXED:NO /OPT:REF /INCREMENTAL:NO /LIBPATH:"%(PSDK)s\\lib" /LIBPATH:"%(MSVC)s\\lib%(suffix64)s" /LIBPATH:"%(python)s\\libs" /out:%(basename)s%(dllext)s.pyd %(basename)s.obj'
elif self.platform.startswith('osx_'):
# OSX
# macOS
proc = self.platform.split('_', 1)[1]
if proc == 'i386':
self.arch = '-arch i386'
@ -230,6 +230,8 @@ class CompilationEnvironment:
self.arch = '-arch ppc'
elif proc == 'amd64':
self.arch = '-arch x86_64'
elif proc in ('arm64', 'aarch64'):
self.arch = '-arch arm64'
self.compileObjExe = "gcc -c %(arch)s -o %(basename)s.o -O2 -I%(pythonIPath)s %(filename)s"
self.compileObjDll = "gcc -fPIC -c %(arch)s -o %(basename)s.o -O2 -I%(pythonIPath)s %(filename)s"
self.linkExe = "gcc %(arch)s -o %(basename)s %(basename)s.o -framework Python"