-
Notifications
You must be signed in to change notification settings - Fork 91
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
DotNET: Implement new bootstrap #1756
base: master
Are you sure you want to change the base?
Conversation
function(add_shared_plugin target) | ||
add_library(${target} SHARED ${ARGN}) | ||
configure_plugin(${target}) | ||
endfunction() | ||
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are completely unused by the SWIG build, and can be removed.
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.