David Dubbeldam The Apple M1 chip is based on the ARM instruction set. To compile for the M1, add the target flag to the llvm compiler Copy to Clipboard -target arm64-apple-macos11 -mmacosx-version-min=11.0 To compile for x86_64 on the Apple M1 use the following flag Copy to Clipboard -arch x86_64 Copy to Clipboard #if arch(arm64) // Code meant for the arm64 architecture here. #elseif arch(x86_64) // Code meant for the x86_64 architecture here. #endif To see the architectures present in a built executable file, run the lipo command-line tool Copy to Clipboard lipo -archs executable To generate an universal binary, use the lipo command-line tool Copy to Clipboard lipo -create -output universal_executable x86_executable arm_executable Note that the same command applies to generate universal static libraries.