I’m using Mono to write a wrapper over a set of natively exposed commands.
The set is the same (commands and signature), however it is exposed through a DLL in Windows and a DyLib in Mac.
I was wondering if there was a way for me to create only one wrapper .NET/Mono DLL while having it still find the right library from which to import by itself.
If so, what would be the syntax? If not, what would be the compiler definitions that would separate the DllImport from 2 different OS on which I’d compile?
EDIT: Bonus points for a static lib (.a) instead of a dynamic lib (.dylib) for the Mac part, if that is even possible with Mono.
You will probably want to ship a dll map config file that tells Mono which library to load on each platform:
http://www.mono-project.com/Config_DllMap