Basic question: Can one specify, when building a static library (and ONLY when building the static library), that the static library needs to link with a shared object?
I'm working on a project that looks like this:
- StaticLib
- Application1 - links with StaticLib
- SharedObject - links with StaticLib
- Application2 - links with SharedObject
I only own StaticLib.
I'd like to add a dependency on a 3rd party SharedObject to the StaticLib. I know that the 3rd party SO exists on all the machines that my software is going to run on, which is good because I'm also restricted by licensing from distributing that 3rd party SO in anyway.
Just playing around, I can get it to work so long as I tell the linker at every application level that I need to link with the 3rd party SO. The problem is twofold: I don't own the build process for those applications AND I'm actually simplifying and there are a lot of applications and SOs that use my static library, some of which are completely outside of my org and I don't know what they are.
As I said, I'm restricted by licensing from distributing the 3rd party SO, so the solutions I've seen that talk about how to fold the SO into a static library won't work for me; that would be distributing the 3rd party SO and I'm legally blocked from doing that.
Is there any way to make this work?
As a follow up, MOST of the uses of my static library will be via SharedObject. If there's a way to make this work such that I must modify the build process for the handful of applications that directly use StaticLibrary and and modify the build of SharedObject, but not have to modify the build of applications that use SharedObject, that'd be workable.