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

Implement dynamic loading of modest library. #1

Open
rikkimax opened this issue Jun 13, 2018 · 2 comments
Open

Implement dynamic loading of modest library. #1

rikkimax opened this issue Jun 13, 2018 · 2 comments

Comments

@rikkimax
Copy link

Just an FYI, but because of the way dub works, you won't have modest compiled and ready to go when you use it as a dependency.

The only reason it works for you is that you're running examples from within the same repo.

Also git submodules are unsupported in dub.

To make this work you will need to use dynamically loading similar to Derelict bindings (use DerelictUtil to handle all the platform specific bits). So that it is deferred to runtime.

@trikko
Copy link
Member

trikko commented Jun 13, 2018

I know. This library is tested on linux only, so I assume you can compile and install modest easily on your system (by following readme instruction). Unfortunatly I have no windows machine to test with, so If anyone can help (compiling modest, etc...) pull requests are welcome.

@rikkimax
Copy link
Author

rikkimax commented Jun 13, 2018

The solution we have come up with on IRC is to:

Write up an implementation of each individual function (__traits(allMembers can do this automatically for you) which will forward to a dynamically loaded function (typeof pair with the function name to get type will help here). DerelictUtil can be used (and should be) to handle all of the platform specific parts. It can be enabled by choosing a configuration (default possibly) from dub which sets a version enabling this wrapper.

The reason for this wrapper is to prevent having to modify the binding (directly which is deimos style) as it is big. It's much easier to implement the functions and forward them to the c version.

@trikko trikko changed the title Unusable as a dependency by dub Implement dynamic loading of modest library. Jun 13, 2018
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

No branches or pull requests

2 participants