Building for different architectures

This is perhaps worth at least raising for developer documentation. I managed with @a.harker 's help to build FrameLib for the M1 architecture. It is relatively simple to do - you just need to change some of the Xcode configurations.

Below is the diff of my .xcconfig

diff --git a/Config_FrameLib.xcconfig b/Config_FrameLib.xcconfig
index fa6074da..ae7ea8b1 100755
--- a/Config_FrameLib.xcconfig
+++ b/Config_FrameLib.xcconfig
@@ -5,12 +5,12 @@ PRODUCT_NAME = $(TARGET_NAME)
 // Per architecture and deployment settings
-ARCHS = i386 x86_64
+ARCHS = x86_64
 LLVM_LTO = Monolithic

Very simple!

Thanks James!

Just to clarify - technically this is a build for intel 64 bit but set up so that it will run on Rosetta 2 - it isn’t yet an ARM build…

Likely when cycling74 go to ARM then I’ll move the default build settings to Universal Binary 2, meaning that the externals should run on Intel and M1 native.

Ah yes, I forgot to clarify this. Thanks.


Does the Mac OS deployment target make a substantial difference here?

I can’t see why that change would be needed to run on M1, but it’s possible James needed to change it because the SDK wouldn’t support something so old.

Actually, I changed that line with the instruction flag so its likely it can be whatever you want I imagine.