Add MESSAGEPACK_FORCE_AOT preprocessor directive#1701
Add MESSAGEPACK_FORCE_AOT preprocessor directive#1701AArnott merged 2 commits intoMessagePack-CSharp:masterfrom
Conversation
|
Why not just set |
I'd considered this, but had concerns about the impact it could have on other packages relying on ENABLE_IL2CPP if set globally in the Editor, so opted to target the functionality in MessagePack directly |
|
Thank you for the changes @brwhelan-msft . For maintainability, at least where it is used often, I think it would be good to have this defined: And check for |
I like the suggestion, but I'd go further and say it should be used consistently at the top of any file that uses any of these Defines symbols. Otherwise it seems likely we'll regress in later code changes. |
|
Great idea - I've just pushed an update which switches to defining DYNAMIC_GENERATION at the top of any files affected, and using it throughout |
AArnott
left a comment
There was a problem hiding this comment.
Looks great. I'll wait a few more days for @nuecc to chime in before merging.
Adds a MESSAGEPACK_FORCE_AOT preprocessor directive which forces the same behaviour as IL2CPP under Unity, requiring formatters to be generated ahead of time via MPC/Source Generators.
This is useful when working in the editor, since at the moment a project running in the Editor runs under Mono, so will generate IL, but then building to IL2CPP can result in failures if the formatters haven't been generated. Setting this directive will result in this failing in the editor, providing consistent results against IL2CPP builds