How to declare against local libs?

I’m trying to access functions of a lib that I plan to include in my app.

Using the format

declare function name lib "libname.dylib" ()

doesn’t seem to work - I always get a “image not found” crash error, no matter where I place the lib inside the app bundle (Frameworks, MacOS, Resources).

I remember that there’s a way to reference the executable inside the lib path, but I’ve forgotten how that works, and the docs for declare don’t mention it, either.

Who knows what I mean?

Ah, nevermind. Google helped:

declare function name lib "@executable_path/libname.dylib" ()

works if I place the lib inside the Contents/MacOS folder.