Open johannesvollmer opened 2 years ago
Note: As wasm3
is the only wasm library that does not require System.Reflection.Emit
internally, it is the only option for running wasm on iOS in Unity. Therefore, Wasm3DotNet
should want to support iOS.
Disclaimer: I did not actually test whether it is currently already possible to run on iOS, just assuming the unity docs are still valid.
Inside of Unity, we cannot pass any flags to the managed dll. But, we can define constraints that can control which dll is selected in which platform. So maybe we can have two different managed dlls, one for static linking and one for dynamic linking, and then in Unity choose the static linking variant on iOS?
Since I have no knowledge about iOS development, I cannot help with actual programming on this issue. However, supporting iOS might be possible with the three steps:
.a
) equivalent of wasm3_dll
.#if UNITY_IOS
conditional compilation in NativeFunctions.cs
.Sorry for forgetting this issue for long time.
Don't worry, it's fine :) due to iOS being very restrictive about code execution, this will probably not get into to AppStore either way. They only allow code downloaded and executed by their WebKit view.... which might include web assembly, but definitely excludes wasm3
As iOS libraries are statically linked in Unity, the
DLLImport
attributes might need to be configurable.See unity docs example for native libraries. Of course, this would not be done with a weird
UNITY_IPHONE
flag, but with some other generic mechanism.Any ideas? I am willing to contribute, but need some hints. How could we approach this?