In my opinion (and experience), it's easier to make a fat lib. This is how most things are distributed on the platform moving forward. Technically, providing the arches as separate files should be possible but the question comes down to naming and/or separating the distribution in such a way that the system lib loading can find them correctly. With a fat lib build, you don't have to worry about it. I have honestly never bothered to figure out the separate arch, separate lib approach beyond major differences of OS versions ie. macOS 10.6 - 10.9, macOS 10.10+, etc.

On Jun 15, 2022, at 1:32 PM, pd-dev-request@lists.iem.at wrote:

Message: 2
Date: Wed, 15 Jun 2022 13:32:09 +0200
From: Roman Haefeli <reduzent@gmail.com>
To: pd-dev <pd-dev@lists.iem.at>
Subject: Re: [PD-dev] Compiling fat external binaries for Mac OS X
Message-ID: <ce868065d84420fd1d5115a34b0f433ba0a82d70.camel@gmail.com>
Content-Type: text/plain; charset="UTF-8"

On Wed, 2022-06-15 at 12:53 +0200, Dan Wilcox wrote:

On Jun 15, 2022, at 12:00 PM, pd-dev-request@lists.iem.at wrote:

Message: 1
Date: Tue, 14 Jun 2022 14:23:16 +0200
From:?reduzent@gmail.com
To:?pd-dev@lists.iem.at
Subject: Re: [PD-dev] Compiling fat external binaries for Mac OS X
Message-ID:
<3646dbc2fcbfdf0a16d8feb20aa7bb11a6f5db58.camel@gmail.com>
Content-Type: text/plain; charset="UTF-8"

On Wed, 2022-06-08 at 20:04 +0200, Dan Wilcox wrote:
You can simply pass in the arches you want using the "arch"
makefile
variable:

make arch="x86_64 arm64"

That's cool to know. In the case of purest_json, I believe it ships
with other dependencies (libjson?) and if those come from homebrew,
they're probably not fat. Is my assumption correct, that a fat
binary
would have to link to fat binary??

I don't believe so. I think (not 100%) the system lib loading
mechanism just needs to find the lib *and* have the right arch. I
don't believe it matters if the lib is fat or not.


Thanks for the clarification. The interesting question (to me at least)
is: If I want to support both archs, does the linked library need to be
fat, or can I link to two separate files per dependency? If I can't
link to different files for different archs, this means there is no
other way  for maintaining support of both archs than to link to a fat
library.

Roman

--------
Dan Wilcox
@danomatika
danomatika.com
robotcowboy.com