I remember reporting a similar issue with native libraries in a library project for Android several years ago. The native libraries did not get built into the output apk unless they were added to the startup project. They did not work when added to a library project that was referenced by the startup project. That issue was fixed back then with the <EmbeddedNativeLibrary>
tag in the csproj. Native libraries can now be referenced in the library project where they belong, and they will get added to the output apk. This has worked for several years now.
The same issue is now happening on Mac, but with Native References and app bundles. Adding a dylib as a Native Reference in a library project means that dylib is not included in the app bundle. Adding the dylib as a Native Reference in the startup project does include the dylib in the app bundle.
I'm using Visual Studio for Mac.
LibraryProject - References - Native References - libopenal.1.dylib <-- Native Reference in LibraryProject - ... MyAppProject - References - LibraryProject <-- References LibraryProject - Native References - ...
Does not include libopenal.1.dylib in the app bundle.
LibraryProject - References - Native References - ... MyAppProject - References - LibraryProject <-- References LibraryProject - Native References - libopenal.1.dylib <-- Native Reference that should be in LibraryProject - ...
Does include libopenal.1.dylib in the app bundle.
Am I just doing this wrong?
Posts
Hmm. That should work. A few things.
That's the same thing they said when I reported the Android issue several years ago.
I made a small repro project that demonstrates the issue.
https://github.com/KonajuGames/DylibTest
Using Visual Studio Community for Mac 7.0.1 (build 24).
Gist of clean build log.
https://gist.github.com/KonajuGames/50c17fa1f7ff062cb51ad2964469989b