[CMake] creating static library with references to other .lib files

Brandon Van Every bvanevery at gmail.com
Wed Jun 13 11:12:32 EDT 2007


On 6/12/07, Jesper Eskilson <jesper at eskilson.se> wrote:
> 2007/6/12, Brandon Van Every <bvanevery at gmail.com>:
> >
> > I don't know what the MSVC linker can accomplish.  Would suggest reading
> the MSVC docs to make sure it can be done.
>
> I *know* that it can be done, since our current hand-written .vcproj files
> do it.

Ok, so MSVC can do it, but AR can't.  So I guess you only care about MSVC.

> > What you're asking for seems kinda weird.  What's the motive?
> >
>
> foo.obj and bar.obj uses symbols in mydll.dll, and I want to allow users of
> mystatic.lib to just have to link with mystaticlib.lib, and not with
> mydll.lib.

But why don't you just ship your users a dynamic lib?  As far as I
know, there are no restrictions on dynamic libs including static libs.

I wonder if you can yank out the object files of an arbitrary static
lib and stick them in your own static lib.  I didn't try that approach
because I have control of all my libs, I'm not using any 3rd party
libs.


Cheers,
Brandon Van Every


More information about the CMake mailing list