Architecture in a multi target project

How is the architecture determined in a multi target project ?

I tried adding the arm64 .so generated for watchos to an xcode project and it says “linked library is missing one or more architectures required by this target is missing : armv7k”

In the settings for toffee static and dynamic projects it has architecture but thats not the case with a multi target project.



unless its set for each target, it uses the default value. same os for single-target, really (except you cant set it via the IDE in multi-target because the IDE doesn’t support settings for multi-target yet ;).

I found this page

and I set it to all


because I didnt know the valid ones.

“all” on global level will work well, yes.

If I build all architectures in a Toffee.WatchOS target what is that producing ?

It only gives me one .a file but multiple headers

Screen Shot 2021-12-29 at 1.02.14 PM

Toffee merges libraries by default (always has).

Island generates each architecture separately (for consistency as the other non-Cocoa platforms dont’ support merging). Only executable projects are merged into a final single fat/universal binary.

you can override this my setting MergeArchitectures to True or False, on either (it default to True for Toffee always, and for Island if the output type is “Executable”). But I suggest to not mess with that, unless you have to.

Headers of curse cant be merged (easily) so even Toffee generates 2 or more; in most cases they will be virtually identical.

Thanks. I was wondering if that was the case. I merged the island ones by hand using lipo

1 Like

If you do want them merged, set MergeArchitectures so you can safe the extra step. Caveat that I didn’t test how Island reacts to then trying to reference the from a different island project, as project reference or regular reference, but I’d love to hear if it goes ok.

I tested with an island console and it looks ok.

Should it create more than one .a file ? I cant tell which is toffee and which is island. It also looks like only toffee creates header files. (1.5 MB)

Screen Shot 2021-12-29 at 4.20.28 PM

Unless set differently, they probably all write to the same folder, ie the one that builds later overwrites then one from earlier. youn might wanna set OutputPathUsesModes to True, if you don’t wanna set explicit OutputPaths for each target manually.

Hmm, yet in your other thread we were talking about problem with an Island header file…