Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test iOS Support #4

Open
timleader opened this issue Nov 13, 2014 · 2 comments
Open

Test iOS Support #4

timleader opened this issue Nov 13, 2014 · 2 comments

Comments

@timleader
Copy link
Member

No description provided.

@TimAidley
Copy link
Contributor

The biggest problem with iOS support I've had is with linkage. As it's set up at the moment, the webp source is compiled in with the project, meaning that the DllImport has to be "__Internal", rather than "libwebp" like the other platforms. The obvious solution to that is to compile the webp code into a library separately like the other platforms and use that. Unfortunately I've had no luck with that route - there's probably something infuriatingly simple I've done wrong.

Anyway, currently I have it working by including the webp.net code in the Assets directory and predicating the linkage on UNITY_IPHONE. To get the unsafe code to compile, I added '-unsafe' to the smcs.rsp files. It's not very pleasant, but it's working for me at the moment. If I get time I will revisit making libwebp.a for iOS.

@timleader
Copy link
Member Author

This is still somewhat incomplete, however the original plan was to implement this linkage of libwebp in much the same way as I have in https://github.com/octo-code/snappy-unity3d. In snappy-unity3d the .net wrapper switches dynamically at runtime between [DllImport("snappy")] and [DllImport("__Internal")] depending on the UnityEngine.Application.platform. The native source code is imported into the unity xcode project where it is compiled alongside the unity project. This solution is not ideal and I would much prefer to import a compiled lib into the xcode project instead of the native source code however due to not having a mac its proving difficult to make any progress with this ideal solution.

If you do get a chance to look into a precompiled lib for iOS it would be much appreciated.

I will be pushing an update soon that will perform the dynamic switching between DllImport cases within the .net wrapper this should hopefully allow you to be able to stop pulling the webp.net code into the unity project and compiling all unity code with the unpleasant '-unsafe' parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants