Am 10.10.2014 14:14, schrieb Drasha:

On Fri, 10 Oct 2014 11:52:16 GMT, Martin Nowak wrote:

Is it possible to somehow do it with dub?

Well vibe.d does it with openssl https://github.com/rejectedsoftware/vibe.d. You would have add linker flags to your libssh package. Not sure if the pathes work out.

Yes, that's what I had in mind. Should have checked it first...
However, I still have a problem (sort of). In my project I want to use vibe.d alongside libssh2. If I prepare dub package for libssh2, each will have its own version of openssl. While .lib files could be kept separate, there can be only one .dll (unless I give it some funny name to distinguish it).

It would be best to be able to share these libraries across dub packages, but I guess that is currently impossible and very improbable in the future.

Thoughts?

Is it necessary to actually have two versions? Unless I'm mistaken, that
would always cause the linker to throw errors due to duplicate symbols,
except if the main application would dlopen its version of OpenSSL
instead of statically linking against it.

But the OpenSSL API is very stable, so it shouldn't matter much if a
newer version is used for either the application, or for libssh2.
Ideally, I would imagine to have two packages, one for OpenSSL and one
for libssh2, where each provides its part of the equation (linker flags
on Posix and linker flags + binaries on Windows). The libssh2 package
would then simply depend on the OpenSSL package to get its version of
the OpenSSL library.