We are using the newer Generate OSX Xcode Project facility, in Unity 2019.3.10f. We are also using the ability to attach a .mm file to the XCode project to facilitate our GameCenter access needs, using native code. We use normal C#/C Interop features to talk to that native code. This works fine for IOS in both debug/release and also works fine for OSX, when in debug.
However, when generating a release build, the interop appears to break. We are definitely not generating a Development build when using the release config in XCode on OSX - doing so gives errors on the console when interop cannot find the C Functions it is looking for. When we turn off the development flag in unity build settings and use a release build of the resulting XCode project, those console errors go away. However, while they go away, the C functions are never called and, in fact, the C# code that calls them using Interop will crash internally and abort that current C# processing thread, albeit silently.
We are using a dll name of “__Internal” for all uses of the .mm native code function calls, which appears to work for IOS debug/release, IOS debug/release and OSX debug, but I suspect this doesn’t work for release on OSX. What should this value be for OSX release?
If it is supposed to be “__Internal”, can Unity give any other details as to why the interop fails when building an OSX non development unity build, and release build in XCode? And what we can do about it?