Hi, I am trying to use SWIG with Xamarin.Forms for cross-platform C# mobile development. I have successfully SWIGged some C code and can build .a libraries for iOS and .so libraries for Android.
Unfortunately, the libraries cannot use the same name on both platforms. I normally use something like the following in my C# code to get around it: #if __IOS__ private const string MY_LIB_NAME = "__Internal"; #elif __ANDROID__ private const string MY_LIB_NAME = "libfoo.so"; #else // windows private const string MY_LIB_NAME = "libfoo"; #endif After this I simply use MY_LIB_NAME in all of the DllImport lines. Although I can simply copy-paste this code into SWIG’s PINVOKE layer and find-replace all of the hard-coded library strings in each of the DLLImport lines, it would ideally
be best to have SWIG just do this for me. I tried passing MY_LIB_NAME on the command line but SWIG still tries to put it in quotes, so I end up having to find-replace anyway without gaining anything. If this is not possible, should I just use something like sed on the command line to perform some post-processing? Thanks, Jeff ------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik _______________________________________________ Swig-user mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/swig-user |
This/similar issues have been discussed before. I can't remember what the outcome was in the end but here's the git issue https://github.com/swig/swig/issues/347 On 25 October 2016 at 14:01, Gonzales, Jeff <[hidden email]> wrote:
-- ------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik _______________________________________________ Swig-user mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/swig-user |
Free forum by Nabble | Edit this page |