DotNET: Implement new bootstrap#1756
Conversation
| function(add_shared_plugin target) | ||
| add_library(${target} SHARED ${ARGN}) | ||
| configure_plugin(${target}) | ||
| endfunction() | ||
|
|
There was a problem hiding this comment.
PInvoke cannot accessed exported symbols of "Module" visible libraries, so I added a new function here with different visibility.
We can also change the plugin default to have shared visibility, which would allow C# code to directly call exports from other NWNX plugins.
I can inline this directly in DotNET/CMakeLists if you do not want this added here.
| if (messageType == "ON_NWNX_LOADED") | ||
| { | ||
| Bootstrap(); | ||
| } |
There was a problem hiding this comment.
Bootstrapping was moved to the end of NWNX init to allow for all enabled NWNX plugins to be loaded, in-case C# code attempts to use exports from other plugins.
There was a problem hiding this comment.
These files are completely unused by the SWIG build, and can be removed.
|
Is this good to go in? I assume it doesn't beak any existing DotNet stuff? |
This PR introduces a new method of bootstrapping C# assemblies that reduces the boilerplate code in C# & C++, and improves portability with simple C-style exports that matches the convention used by other NWNX plugins.
The updated bootstrapping code is backwards compatible, and should not be ABI breaking.