Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jhett12321
Copy link
Contributor

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.

Comment on lines +33 to +37
function(add_shared_plugin target)
add_library(${target} SHARED ${ARGN})
configure_plugin(${target})
endfunction()

Copy link
Contributor Author

@jhett12321 jhett12321 May 5, 2024

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.

Comment on lines +179 to +182
if (messageType == "ON_NWNX_LOADED")
{
Bootstrap();
}
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant