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

Linking directly to nbind.node #105

Closed
BotellaA opened this issue Jan 17, 2018 · 3 comments
Closed

Linking directly to nbind.node #105

BotellaA opened this issue Jan 17, 2018 · 3 comments

Comments

@BotellaA
Copy link

I have another (maybe silly) question about nbind.

Could it be possible to compile nbind sources alone in a nbind.node and then link my libraries with it? Should it works or is there something to do with node addon linking?

Thanks

@jjrv
Copy link
Member

jjrv commented Jan 17, 2018

Most of the code in nbind is template metaprogramming, generating code at compile time based on declarations in your libraries. What you suggest might be possible, but you'll need to put the NBIND_CLASS macros in separate files (because they need to be compiled together with nbind) and you might have to tweak the linking to get it working.

@BotellaA
Copy link
Author

If using nbind with several libraries becomes possible, this feature could be very nice.

@BotellaA
Copy link
Author

BotellaA commented Jan 22, 2018

It is starting to work. I have copy and paste the v8/Binding.cc code inside each of my nbind addons. The goal is to have the NBIND_CLASS of NBind and to call a NODE_MODULE with the same initModule.

Could it be possible to separate the NBind class implementation from the remaining of the file? My idea is to compile nbind alone and only add in my addons the v8/Binding.cc file without NBind class implementation. This should simplify a lot the creation of nbind addon.

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