The Merge task, invoked for Cocoa and Island/Darwin targets only, is used to merge different architectures into a single "fat" binary.

When building projects for multiple architectures (for example arm64 and armv7, for iOS), the compiler and linker run separately for each architecture, generating independent executables. The MergeToffee task takes the binaries for each architecture and combines them into the final "fat" or "universal" binary that you will ship.

Currently the only platforms that support/need merging are iOS apps, when they are set to include legacy 32-bit (armv7 or device or i386 for simulator) support.

  • Implemented in ElementsMergeToffee, runs once per target.




If only a single architecture is set, the task merely re-adds the inputfile, unchanged, as output to MergedLinkerOutput-*. If multiple architectures are present, the files are combined, using custom merge logic for static libraries, and by calling lipo for all other project types.


  • CompilerOutput-* objects (for static libraries)
  • LinkerOutput-* objects (for all other projects)


On success, new MergedLinkerOutput-* objects will be created, for device and/or simulator.


The result of merging resolving is cached in LinkerMerge-*.caches, per Device/Simulator (Cocoa only), subject to the date of the project file and the compiler/linker input.