spotify / XCRemoteCache

Other
833 stars 52 forks source link

Support producer mode on Apple Silicon #39

Closed polac24 closed 2 years ago

polac24 commented 2 years ago

PLATFORM_PREFERRED_ARCHbuild setting is still resolved to x86_64 on M1 machines (see a report here). The aim of using PLATFORM_PREFERRED_ARCH was to find a default architecture to build.

PLATFORM_PREFERRED_ARCH values:

For Intel machines, it is:

For Apple silicon machines, it is:

Solution

Instead, we can recognize the architecture from the ARCHS env. For a default Debug configuration, it always resolves to a single architecture. If "Build Archive Architecture Only" is disabled (not recommended), we can just the first one.

ARCHS values:

For Intel machines, it is:

For Apple silicon machines, it is:

when ONLY_ACTIVE_ARCH=NO

For Intel machines, it is:

For Apple silicon machines, it is:

Fixes #33

imWildCat commented 2 years ago

Thanks a lot!