-
-
Notifications
You must be signed in to change notification settings - Fork 744
Add MESSAGEPACK_FORCE_AOT preprocessor directive #1701
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
Add MESSAGEPACK_FORCE_AOT preprocessor directive #1701
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
@neuecc Any concerns or alternative ideas?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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