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

Driver.Options attributes information #730

Closed
zillemarco opened this issue Jan 16, 2017 · 12 comments
Closed

Driver.Options attributes information #730

zillemarco opened this issue Jan 16, 2017 · 12 comments
Labels

Comments

@zillemarco
Copy link
Contributor

I'm currently developing the CLI tools for CppSharp and I'm trying to understand the difference between these two Driver.Options attributes: Driver.Options.LibraryName and Driver.Options.SharedLibraryName.

Could you please explain the difference so I can give the end user informations about these properties?

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

LIbraryName is the name of the generated binding. SharedLibraryName is the fallback for the native library to P/Invoke if Libraries and LibraryDirs are not used.

@zillemarco
Copy link
Contributor Author

Thank you very much.

Also, Libraries is a list but, as far as I have seen, the generated bindings P/Invoke from only one library, so why is Libraries a list and not simply a String?

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

This way one binding can wrap more than one native library. It's almost always better to have one binding per native library but we have decided to leave it more flexible.

@zillemarco
Copy link
Contributor Author

Ok but then how can the user achieve this? I mean, if I have two include files, like a.h and b.h that generate respectively a.dll and b.dll and I want to generate the bindings for both inside the file bind.cs, how does CppSharp know that the content of a.h should P/Invoke from a.dll and the content of b.h should P/Invoke from b.dll?

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

A good question, I really forgot mentioning something important. When SharedLibraryName is not used, the CheckSymbols option must be enabled so that the correct symbol from the correct library is found.

@zillemarco
Copy link
Contributor Author

So in this case I should have SharedLibraryName unset, add a.dll and b.dll to Libraries and set CheckSymbols to true if I understood correctly.

Oh, and since we are in the mood, what does the UnityBuild flag means? :)

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

For some of the options, UnityBuild in particular, you can see their description in the source code as XML code comments. Still, I do hear you, we should definitely add some documentation for the options.

@zillemarco
Copy link
Contributor Author

Yeah, I've noticed only now the UnityBuild description. Sorry about all my questions but I wanted to understand these options in particular so that I can provide the best help I can to the CLI tools.

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

No need to apologise at all, on the opposite, I am happy with your interest. Besides, you are touching an important point here, our documentation need some serious improvement.

@zillemarco
Copy link
Contributor Author

zillemarco commented Jan 16, 2017

Well, I must admit that the first time I saw CppSharp I couldn't understand how it worked so I had to find examples from other users. The link to the CppParser bindings generator you sent me was a great help since it covered almost all I needed, but without asking you I would have never been able to catch the difference between the use of SharedLibraryName and Libraries.

@ddobrev
Copy link
Contributor

ddobrev commented Jan 16, 2017

I agree. The problem is that we still lack important features such as templates and cannot get to the documentation and examples. Anyway, if you're done with your questions for now, please close this issue.

@zillemarco
Copy link
Contributor Author

Yes of course.

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

No branches or pull requests

3 participants